我尝试运行以下代码:
SqlCeEngine engine = new SqlCeEngine( connStr );
engine.CreateDatabase( );
SqlCeConnection conn = null;
conn = new SqlCeConnection( connStr );
conn.Open( );
string eh =
@"Create table test(ID INT IDENTITY NOT NULL PRIMARY KEY, DateTest DATETIME);
Create table test2(ID INT IDENTITY NOT NULL PRIMARY KEY, DateTest DATETIME);";
SqlCeCommand hm = new SqlCeCommand(eh, conn);
hm.ExecuteNonQuery();
但是,当我尝试执行 ExecuteNonQuery 时,出现以下异常:
{解析查询时出错。[令牌行号=2,令牌行偏移量=1,错误令牌=创建]}
任何想法可能导致这种情况发生?