sql mobile 写入问题
本人使用VS2005+sql mobile 开发应用程序 使用代码插入数据,程序运行没报错 但之后通过sql 2005查看结果显示没有插入数据。
代码如下:
System.Data.SqlServerCe.SqlCeConnection conn = new System.Data.SqlServerCe.SqlCeConnection();
conn.ConnectionString = " Data Source='storage card\\MyDatabase1.sdf' ";
conn.Open();
string sql_string2 = "insert myfavourite(shopid) values(66)";
System.Data.SqlServerCe.SqlCeCommand comm = new System.Data.SqlServerCe.SqlCeCommand(sql_string2, conn);
comm.CommandType = CommandType.Text;
int output = comm.ExecuteNonQuery();
comm.Dispose();
conn.Close();
return output;
output显示的1但查看数据库发现没数据。
请各位高手解答。谢谢。