Below is the code snippet in which i tried to use nested query with FillSchema. if I run this, it throws exception. If I remove the nested query, it works fine.
OracleConnection conn = new OracleConnection("Data Source=DB;User Id=abc;password=abc;");
//string query = "select emp_id, emp_name_1 from employee where emp_name_1 like 'ABB%' and rownum != 10 order by emp_name_1";
string query = "select emp_id, emp_name_1 from (select * from employee where emp_name_1 like 'ABB%' order by emp_name_1) a where rownum != 10";
OracleDataAdapter da = new OracleDataAdapter(query, conn);
DataSet ds = new DataSet();
da.FillSchema(ds, SchemaType.Mapped, "table");
da.Fill(ds);
dataGrid1.DataSource = ds.Tables[0];
Regards,
Venki
|