简单问题请教:sqlserver查询
有一个表名:ts_i,里面有au,ma,pl等若干个字段(au的类型为char).
我想找出所有au为East640302的记录,只要au,ma,pl三个字段。
以下是我的一段代码,总是报错:
***************************************************************
string sqlTs = "select au,ma,pl from ts_i where au=East640302";
SqlDataAdapter da1 = new SqlDataAdapter( sqlTs ,cnToTs);//连结cntots也正确
ds = new DataSet();//ds前面已定义
try
{
da1.Fill(ds, "Ts" );
}
catch(Exception ee)
{
MessageBox.Show(ee.ToString());
}
*******************************************
报错的信息:
system.data.sqlcilent.sqlexception:
invalid column name 'east640302'.
at .....executereader(....)
at......fillfromcommand(...)
at......fill(....)
at...