Hi,
i am using the following query
string query = "SELECT *"+
"FROM DataSet"+
"WHERE Param_ID =(Select Data1 from testcases
where TestCaseID='TC001')
DataAdapter da=new DataAdapter();
mycommand = new OleDbCommand(query, mycon);
myds = new System.Data.DataSet();
da = new OleDbDataAdapter();
da.SelectCommand = mycommand;
===============PROBLEM================
//da.TableMappings.Add("Table", "testcases");
da.TableMappings.Add("Table", "DataSet");
if i add both the tables compiler gives error.
Marc Gravell - 07 Apr 2008 10:22 GMT
I doubt that the *compiler* would complain about that. The runtime might
throw an exception - firstly because you have duplicated the
table-name, and second because you only seem to be returning a single
grid of data...
Perhaps post the actual error text?
Marc
nologo - 07 Apr 2008 11:21 GMT
capture the error with
try
{
da.TableMappings.Add("Table", "DataSet");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
Cor Ligthert [MVP] - 07 Apr 2008 12:00 GMT
Nannu,
As Marc wrote already will your code forever only returning one row.
As you want to retrieve two resultsets in one fill, you need at least to map
table and table1 (or any tablename you start with your fill).
Cor
> Hi,
>
[quoted text clipped - 14 lines]
>
> if i add both the tables compiler gives error.