S
Simon Tobias
The following code returns an InvalidOperationException
syntax error when stepping over the da.FillSchema
statement :
Syntax Error: Expecting ',' or 'FROM' after column alias
or '*'.
The same code works fine using either the MS OleDb data
provider or Oracle's native provider. If I add parentheses
around BUDGET*5, then the code executes as expected.
string connStr = "Data Source=myserv;User
ID=scott;Password=tiger;";
OracleConnection conn = new
System.Data.OracleClient.OracleConnection(connStr);
string sql = "SELECT BUDGET*5 FROM PROJ WHERE
PNUM='P1'";
OracleCommand cmd = new OracleCommand(sql);
cmd.Connection = conn;
conn.Open();
try
{
DataSet ds = new DataSet();
OracleDataAdapter da = new OracleDataAdapter(sql,
conn);
da.SelectCommand = cmd;
da.FillSchema(ds, SchemaType.Source);
ds.EnforceConstraints = false;
da.Fill(ds);
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
conn.Close();
syntax error when stepping over the da.FillSchema
statement :
Syntax Error: Expecting ',' or 'FROM' after column alias
or '*'.
The same code works fine using either the MS OleDb data
provider or Oracle's native provider. If I add parentheses
around BUDGET*5, then the code executes as expected.
string connStr = "Data Source=myserv;User
ID=scott;Password=tiger;";
OracleConnection conn = new
System.Data.OracleClient.OracleConnection(connStr);
string sql = "SELECT BUDGET*5 FROM PROJ WHERE
PNUM='P1'";
OracleCommand cmd = new OracleCommand(sql);
cmd.Connection = conn;
conn.Open();
try
{
DataSet ds = new DataSet();
OracleDataAdapter da = new OracleDataAdapter(sql,
conn);
da.SelectCommand = cmd;
da.FillSchema(ds, SchemaType.Source);
ds.EnforceConstraints = false;
da.Fill(ds);
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
conn.Close();