CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    1

    Help with DataTable, DataSet, DataGridView

    Hello all,

    I'm using Visual Studio 2008, and I have a few DataGridViews being populated by Oracle stored procedures. I have a static method that adds a checkbox column to the DataSet populating the DGV:

    public static void addCheck(DataSet ds)
    {
    DataColumn dc = new DataColumn("Select", System.Type.GetType("System.Boolean"));
    ds.Tables[0].Columns.Add(dc);
    }

    I need to pick up on the selections in the checkboxes and store the values else where, so I can run them through another stored procedure, but I can't figure this part out. Any help would be much appreciated!

  2. #2
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: Help with DataTable, DataSet, DataGridView

    Your post isn't particularly clear. I will assume that you have another tableadapter that interfaces with the destination for these rows.. Then just do:

    thatTableAdapter.Update( myDataTable.Select("[select] = True"));

    Note: I'd always advise NOT using reserved words as column names. Call your Select column something else
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

Tags for this Thread

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

Featured