insert into 出错
comm.CommandText = "INSERT INTO " + DbfFileName.Substring(0, DbfFileName.Length - 4) + "SELECT * FROM ds1.Tables[\ "fstable\ "] "
注意:
DbfFileName.Substring(0, DbfFileName.Length - 4)是表的名字,
ds1.Tables[\ "fstable\ "]是dataset里一个叫fstable的表
报错原因是insert 语句语法错误,到底错再那儿里了,请各位来看看,我sql不熟
------解决方案--------------------少空格吧.
comm.CommandText = "INSERT INTO " + DbfFileName.Substring(0, DbfFileName.Length - 4) + " SELECT * FROM ds1.Tables[\ "fstable\ "] "
------解决方案--------------------comm.CommandText = "INSERT INTO " + DbfFileName.Substring(0, DbfFileName.Length - 4) + "SELECT * FROM "+ds1.Tables[ "fstable "].TableName;
------解决方案--------------------对, 少空格
comm.CommandText = " INSERT INTO " + DbfFileName.Substring(0, DbfFileName.Length - 4) + " SELECT * FROM ds1.Tables[\ "fstable\ "] "
------解决方案--------------------数据集dataset中的表在数据库里存在吗?如果存在建议直接用表名,不存在的话,这条SQL语句是执行不了的。