string sqlTs = "select au,ma,pl from ts_i where au=East640302";
写为:
string sqlTs = "select au,ma,pl from ts_i where au='East640302'";
试试:)
加个''
写为:
string sqlTs = "select au,ma,pl from ts_i where au='East640302'";
试试:)
加个''
调试欢乐多
对于SQL SERVER里的字符字段及时间字段,查询时都在常量两边应加上单引号。
string sqlTs = "select au,ma,pl from ts_i where au='east640302' and [时间字段] = '2004/6/9 10:50:00'"
SqlDataAdapter da1 = new SqlDataAdapter( sqlTs ,cnToTs);//连结cntots也正确
ds = new DataSet();//ds前面已定义
try
{
da1.Fill(ds, "Ts" );
}
catch(Exception ee)
{
MessageBox.Show(ee.ToString());
}