I would like to have the user type in a query statement, click on a [Test] button and have the query results show in a datagrid.
I'm stuck on the data adapter.TableMappings. This changes depending on the query the user inputs.
Thanks, MikeD
dsQueryResult = new System.Data.DataSet();
daQueryResult = new System.Data.SqlClient.SqlDataAdapter();
myCmd = new SqlCommand();
string cmdStr = "Select * from myTable";
myCmd.CommandText = cmdStr;
dsQueryResult .SelectCommand = myCmd;
daQueryResult .TableMappings.Add() <==== What goes here
// Tell the DataAdapter object to fill the DataSet
daQueryResult .Fill(dsQueryResult );

Data Adapter Table Mapping question vs2005
datapvs
That solves a big question for me.
I will test it.
Mike
Matt Bamberger