How to Add DataSets to DataGrids

104 22
    • 1). Click the Windows "Start" button and select "All Programs." Click "Microsoft .NET Framework," then click "Visual Studio" to open the .NET programming software.

    • 2). Hold the "Ctrl" key, then press "O." The "Open Project" dialog box opens. Double-click the project that contains your DataGrid. After the project loads, double-click the DataGrid control to open the coding file where you bind the DataSet.

    • 3). Type the following code into the file to bind the DataSet:

      DataTable table = CreateData();

      dataGrid1.DataSource = table;

      The code creates the DataSet and assigns it to a DataTable named "table." The table is then bound to the DataGrid.

    • 4). Click the "Save" icon at the top of your workspace window. Click the "Run" button to compile the new code and review your changes in a web browser.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.