none
Data Access Application Blocks - DataGridView RRS feed

  • Question

  • Hi all,

    How would I go about populating a DataGrid view using DAAB? I've tried the following

     

    Code Snippet

    MyDataSet = SqlHelper.ExecuteDataset(SQLConnection, CommandType.StoredProcedure, "sp_Select_Security")

    MyDataAdapter.Fill(MyDataSet, "sp_Select_Security")

    DataGridView1.DataSource = MyDataSet

     

     

    But I get a "The SelectCommand property has not been initialized before calling 'Fill'." error. I've also tried the SQLHelper.FillDataSet but it asks for a table name(???). Any help woud be appreciated.

     

    Thanks!

    Monday, August 6, 2007 6:08 AM

Answers

  • Solution...

     

    Code Snippet

    Dim MyBind As New BindingSource

    ...

    MyDataSet = SqlHelper.ExecuteDataset(SQLConnection, CommandType.StoredProcedure, "sp_Select_Security")

    MyBind.DataSource = MyDataSet.Tables(0)

    DataGridView1.DataSource = MyBind

     

     

    Tuesday, August 21, 2007 8:15 PM