Dynamically Populate Datagrid

  • Thread starter Thread starter Soulless
  • Start date Start date
S

Soulless

Hi,

I'm such a nood it isn't funny and apologize for this question in
advance.

I have a datagrid on my form and wish to populate it from a Sybase
source using a dynamic select.

so, basically I can create a select statement in a string and retrieve
it using ExecuteScalar to retrieve. I am not sure though how I can
get from there to having the data appear in my Datagrid.

Am I missing a step, like a dataset object in there?

Is there a link or resource available I could look into that could
step me through what I need to do?

Many thanks!
 
Soulless,

Well, I would ask why you are calling ExecuteScalar. By calling that,
you are getting the first column of data in the first row returned, and
discarding the rest.

Rather, you should create the command and attach it to a data adapter.
Then, fill a data table with the data adapter and then bind that to the data
grid.
 
Back
Top