ASP.NET Popup Yes/No Dialog box

ASP.NET Web Form is still one of the fastest ways to build a simple web site. Yes/Cancel dialog you need to achieve it using JavaScript like the one below.

<asp:Button ID=”myButton” runat=”server” Text=”Delete” onclientclick=”return confirm(‘Are you sure you want to save selected records?’);” OnClick=”myButton_Click” />

Reference: https://www.codeproject.com/Questions/608142/HowplustoplusshowplustheplusPopupplusYes-2fNoplusM

Posted in .Net, Cloud, Community, Computers and Internet | Tagged | Leave a comment

SQL Server Reporting Services (SSRS) what is and tutorial

This post provides the resources for SQL Server Reporting Services (SSRS).

What is SQL Server Reporting Services (SSRS)?

https://docs.microsoft.com/en-us/sql/reporting-services/create-deploy-and-manage-mobile-and-paginated-reports?view=sql-server-ver15?WT.mc_id=DP-MVP-36769

Reporting Services Tutorials (SSRS)

https://docs.microsoft.com/en-us/sql/reporting-services/reporting-services-tutorials-ssrs?view=sql-server-ver15?WT.mc_id=DP-MVP-36769

Create a Basic Table Report (SSRS Tutorial)

https://docs.microsoft.com/en-us/sql/reporting-services/create-a-basic-table-report-ssrs-tutorial?view=sql-server-ver15?WT.mc_id=DP-MVP-36769

Report Builder Tutorials

https://docs.microsoft.com/en-us/sql/reporting-services/report-builder-tutorials?view=sql-server-ver15?WT.mc_id=DP-MVP-36769

Create mobile reports with SQL Server Mobile Report Publisher

https://docs.microsoft.com/en-us/sql/reporting-services/mobile-reports/create-mobile-reports-with-sql-server-mobile-report-publisher?view=sql-server-ver15?WT.mc_id=DP-MVP-36769

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform | Tagged , , | Leave a comment

SharePoint concurrent document upload to Document Library

This post shows the code to simulate the concurrent upload to SharePoint document library using a single account.

Pre-requisite:

1. You have installed SharePoint SDK to your development environment https://chanmingman.wordpress.com/2018/10/07/ssis-could-not-load-file-or-assembly-microsoft-sharepoint-client/

2. You have Office 365 SharePoint online.

3. You know C#.

In my Documents document library, I have a folder named TopFolder.

static void Main(string[] args)

{

    string filename = “”;

    Thread t = new Thread(Go);

    t.Start();

    Thread t1 = new Thread(Go1);

    t1.Start();

    Thread t2 = new Thread(Go2);

    t2.Start();

    Thread t3 = new Thread(Go3);

    t3.Start();

    Thread t4 = new Thread(Go4);

    t4.Start();

    t.Join();

    t1.Join();

    t2.Join();

    t3.Join();

    t4.Join();

    Console.ReadLine();

}

static void Go()

{

    UploadFile(“sperror.txt”);

}

static void Go1()

{

    UploadFile(“sperror1.txt”);

}

static void Go2()

{

    UploadFile(“sperror2.txt”);

}

static void Go3()

{

    UploadFile(“sperror3.txt”);

}

static void Go4()

{

    UploadFile(“sperror4.txt”);

}

public static void UploadFile(string filename)

{

    string siteUrl = https://account.sharepoint.com/DevSite&#8221;;

    ClientContext clientContext = new ClientContext(siteUrl);

    clientContext.Credentials = SignIn.GetPassword();

    Web rootWeb = clientContext.Web;

    string filePath = filename;

    FileCreationInformation newFile = new FileCreationInformation();

    newFile.Content = System.IO.File.ReadAllBytes(filePath);

    newFile.Url = System.IO.Path.GetFileName(filePath);

    SP.List oList = clientContext.Web.Lists.GetByTitle(@”Documents”);

    var folders = oList.RootFolder.Folders;

    clientContext.Load(folders);

    clientContext.ExecuteQuery();

    var folder = folders.Where(r => r.Name == “TopFolder”);

    var folder1 = folder.FirstOrDefault();

    Microsoft.SharePoint.Client.File uploadFile = folder1.Files.Add(newFile);

    clientContext.Load(uploadFile);

    clientContext.ExecuteQuery();

    SP.ListItem item = uploadFile.ListItemAllFields;

    string docTitle = string.Empty;

    item[“Title”] = docTitle;

    item.Update();

    clientContext.ExecuteQuery();

    Console.WriteLine(“Done {0}”, filename);

}

For the SignIn method is as below.

public static SharePointOnlineCredentials GetPassword()

{

    string password = “password”;

    SecureString securePassword = new SecureString();

    foreach(char c in password)

    {

        securePassword.AppendChar(c);

    }

    return (new SharePointOnlineCredentials(“account@account.onmicrosoft.com”, securePassword));

}

Posted in .Net, Community, Computers and Internet, Office 365, Cloud, sharepoint | Tagged , | Leave a comment

Microsoft.SharePoint.Client

This short post is to reduce you the pain to get the Microsoft.SharePoint.cliennt from nuget. Nuget will keep telling you your .NET Framework is incompatible and refuse to install. Get Microsoft.SharePoint.Client from https://www.microsoft.com/en-us/download/details.aspx?id=51679 when the link is still working.

Posted in .Net, Community, Computers and Internet, Office 365, Cloud, sharepoint | Tagged | Leave a comment

SSIS SharePoint Data Destination

This post shows you how to use Office 365 SharePoint as data destination in SSIS Data Flow.

Pre-requisite:

1. You already have basic knowledge on SSIS.

2. You have installed SharePoint SDK to your development environment https://chanmingman.wordpress.com/2018/10/07/ssis-could-not-load-file-or-assembly-microsoft-sharepoint-client/

3. SQL Server Data Tool is installed https://chanmingman.wordpress.com/2014/08/02/sql-server-data-tool-ssdt/.

4. You have Office 365 SharePoint online.

A lot of people are still looking for a SSIS SharePoint data destination. In this post, I will show you how to create a SSIS SharePoint Source with the combination of SharePoint SDK and Script Component in SSIS.

1. Create a SSIS project.

2. Drag Data Flow Task to Control Flow page. Double click the Data Flow Task. Drag OLE DB Source. the Northwind database, Products table. You can create a Connect Manager to connect to the database.

3. Drag Script Component to Data Flow page. When Select Script Component Type pops up then select Destination.


3. Double click the Script Component. Click Edit Script…

4. Replace the Input0_ProcessInputRow method with the following code. Of course, you need to change the siteUrl, password, and login name.

public override void Input0_ProcessInputRow(Input0Buffer Row)

{

    string siteUrl = https://chanmm.sharepoint.com/DevSite/&#8221;;

     ClientContext clientContext = new ClientContext(siteUrl);

     clientContext.Credentials = SingIn.Login();

    SP.List oList = clientContext.Web.Lists.GetByTitle(“NewList”);

    ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();

    ListItem oListItem = oList.AddItem(itemCreateInfo);

    oListItem[“Title”] = Row.ProductName;

     oListItem.Update();

    clientContext.ExecuteQuery();

}

7. Create a signIn class (of course you need to replace the username and password).

class SignIn

{

    public static SharePointOnlineCredentials Login()

    {

    string password = “password”;

    SecureString securePassword = new SecureString();

    foreach (char c in password)

    {

        securePassword.AppendChar(c);

    }

    return (new SharePointOnlineCredentials(“sharepoint@sharepoint.onmicrosoft.com”, securePassword));

}

8. Your final Data Flow Task will look as such.

Posted in .Net, Cloud, Community, Computers and Internet, Office 365 | Tagged | Leave a comment

The problem with Java1z0-808 exam

Why you should not take the Oracle exam 1z0-808. Actually, I have gotten some pretty good past questions from https://www.gratisexam.com/. The problem was, I suspected the answers were questionable. So I have built them using NetBean, many of them, here https://1drv.ms/u/s!Aje-DdIVpfjSinK3jqS3ihfsGgnW?e=qw2FP5. During the exam most of the questions came out but I did not make it.

This means if I follow the wrong answers in https://www.gratisexam.com/ I might have passed. I believe Oracle does not verify the answers using their own compiler after the Java update and so. This is unethical art.

 

Posted in Cloud, Community, Computers and Internet, Data Platform, Java, Oracle | Tagged , | Leave a comment

Getting started with Power BI

This post shares the resources for getting started with Power BI.

Power BI documentation

https://docs.microsoft.com/en-us/power-bi/?WT.mc_id=DP-MVP-36769

What is Power BI?

https://docs.microsoft.com/en-us/power-bi/fundamentals/power-bi-overview?WT.mc_id=DP-MVP-36769

Getting started with Power BI Desktop

https://docs.microsoft.com/en-us/power-bi/desktop-getting-started?WT.mc_id=DP-MVP-36769

Microsoft Power BI Guided Learning

https://docs.microsoft.com/en-us/power-bi/guided-learning/?WT.mc_id=DP-MVP-36769

Power BI for report designers

https://docs.microsoft.com/en-us/power-bi/power-bi-creator-landing?WT.mc_id=DP-MVP-36769

Power BI for consumers

https://docs.microsoft.com/en-us/power-bi/consumer/power-bi-consumer-landing?WT.mc_id=DP-MVP-36769

What is Power BI administration?

https://docs.microsoft.com/en-us/power-bi/service-admin-administering-power-bi-in-your-organization?WT.mc_id=DP-MVP-36769

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform, Office 365 | Tagged , | Leave a comment