Please point me in the right Direction,
I want to know if it is possible to load a grid, with data resulting from a select statement saved in a SQL table. Do you guys have an example I can use? How can I pass parameters to the query?
Thanks
Hi Luis,
Hm, I'm not really sure if I understand exactly what you mean. If you have a table with SQL Statements in it, then at some point, you could have to use another SQL Statement to get the list of SQL Statements. :)
But once you have the list, you just plug the SQL Statement(s) in the DataAdapter.I'm not sure where you are getting stuck there, but like I said, that aspect really has nothing to do with the grid, so you might be better of posting your question on a more general DotNet programming or DataBinding forum.
The grid only deals with the local DataSet (or other data source), so I'm not an expert on accessing data from a database.
Currently I Load data just like you guys have it documented in your samples. I create a string variable to store my select statement, then I use a dataset to bind to the grid; I have many grids that use this same pattern.
What I want to do, is to have a table of Select Statements stored in a DB, where I can have the name of the grid, and the select statement asociated with that grid. Load that into a variable, and bind to the grid. What I dont know, is how to determine what parameters are in that variable and load paramters at run time.
I don't know if this make sence.
The grid binds to an object on the client side like a DataSet or DataTable. It sounds like you are asking how to load your data from a DataBase into DotNet. the grid is not involved in that process - that's a general DotNet issue and it depends on your database and such.
You should check out Microsoft documentation on the DataAdapter classes. That's what most people use to retrieve data from a database and put it into a DataSet, I think.