Dynamically Populate Datagrid

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!
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top