Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strategy for dynamically populating a DataGrid from SQL Server

Status
Not open for further replies.

HerbAndEdnaWeinstein

Technical User
Apr 30, 2003
104
US
Hi, I'm writing a friendly program to help our users query a large, complex SQL database, and output their queries as a text file.

I've just started with programmatic DB access, but so far I've figured out how to establish a connection to a SQL server, pipe the contents of an SQL query to a dataset, then populate a datagrid with the result.

This works fine when the contents of the dataset are defined beforehand. What I'm trying to figure out now is how to only populate the datagrid with the things the user asks for through the interface.

It looks like I could write a function to parse XML into the dataset file, but that seems like reinventing the wheel.

I'm probably overlooking something big. Any ideas?

Thanks in advance,
Herb
 
Here's a little more focused detail:

I'd like to handle this around the SQLDataAdapter1.Fill function, but it looks like most of the data adapter functionality is there to select, insert, delete, and update the scema that is already defined, not to create a new schema on the fly.

Herb
 
Solved my own problem. I don't have to parse out the XML contents of the dataset, I only have to parse out the SQL Select command for the SQLDataAdapter.

That's a relief...

Herb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top