Why error:"Cannot create a child list for field TEST"
In my class1.cs file,code for oracle connection is given below:
public class Class1
{
OdbcConnection orcn;
string stringconn;
string sql;
DataSet dtst;
OdbcDataAdapter dataadapt;
public DataSet conn()
{
orcn=new OdbcConnection();
stringconn="DSN=orclconn;UID=scott;PWD=tiger;DRIVER={Microsoft ODBC for Oracle}; SERVER=adidas;";
orcn.ConnectionString=stringconn;
sql="select * from test";
dataadapt=new OdbcDataAdapter(sql,orcn);
dtst=new DataSet();
dataadapt.Fill(dtst);
return dtst;
}
}
In Form1.cs file, under Form_Load event,I have written:
Class1 cc=new Class1();
ds=cc.conn();
int t=this.BindingContext[ds,"TEST"].Count;
MessageBox.Show("t=",t.ToString());
When I try to compile, the following error occurs:
"An Unhandled exception................................
Cannot create a child list for field TEST"
What's is this error and how to resolve it.