A
Alex K.
Hi all
I noticed that if Select stmt returns dataset containing two tables,
executing FillShema only populates schema info for first table only.
Simple test: (.NET 2.0)
....
string strSQL = "Select * from tableA select * from tableB"
OleDbConnection cn = new OleDbConnection(strConnection);
OleDbCommand cmd = new OleDbCommand(strSQL);
cmd.Connection = cn;
OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
int ret = adapter.Fill(ds);
adapter.FillSchema(ds, SchemaType.Mapped, "Table");
adapter.FillSchema(ds, SchemaType.Mapped, "Table1");
Everything is working fine, except that for second table, shema info is not
set. In particular, MaxLength attribute of all string fields in second table
is always -1. In the first table, MaxLength shows real max length of a field.
Is there any way to fill schema for second table (and other tables if any)?
Thank you
Alex
I noticed that if Select stmt returns dataset containing two tables,
executing FillShema only populates schema info for first table only.
Simple test: (.NET 2.0)
....
string strSQL = "Select * from tableA select * from tableB"
OleDbConnection cn = new OleDbConnection(strConnection);
OleDbCommand cmd = new OleDbCommand(strSQL);
cmd.Connection = cn;
OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
int ret = adapter.Fill(ds);
adapter.FillSchema(ds, SchemaType.Mapped, "Table");
adapter.FillSchema(ds, SchemaType.Mapped, "Table1");
Everything is working fine, except that for second table, shema info is not
set. In particular, MaxLength attribute of all string fields in second table
is always -1. In the first table, MaxLength shows real max length of a field.
Is there any way to fill schema for second table (and other tables if any)?
Thank you
Alex