Results 1 to 2 of 2

Thread: DataTables and DataGrid

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    DataTables and DataGrid

    Can someone give me a little bit of advice on DataTables.

    I need to understand how I can manipulate data from within a datagrid bound to a dataset.

    To do this do I have to create a datatable or is one created automatically. I am a bit lost on the use of the datagrid and need to get my head around it.

    In particular I need to be able to loop through a gris to make appropriate changes.comparisons and am a bit lost.

    Thanks in advance

  2. #2
    Hyperactive Member SoftwareMaker's Avatar
    Join Date
    Mar 2001
    Location
    Elbonia with Dilbert and Wally
    Posts
    322
    Create a dataset first. Fill it with data from the dataadapter and it fills to a datatable within the dataset.

    DataAdapter.Fill(Dataset, "MyTable")

    Bound the datagrid to the dataview of the datatable in the dataset

    DataGrid.DataSource = DataSet.Tables("MyTable").DefaultView

    Every row in the datatable is an objRow

    For each DataRow in DataTable.Rows
    DataRow("ColumnOne") = "Softwaremaker.NET Rocks !!!"
    Next
    William T
    Software Architect / Chief Software Developer
    Softwaremaker.Net Pte Ltd
    http://www.Softwaremaker.net

    *** Things are always the darkest before they go pitch black ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width