c# 使用Parameters方式更新Access数据库
做个代码收集的小程序。对Access数据库CRUD时,U不正常
不太会表达,先看代码吧
插入方法
C# code:
string sql = "Insert Into DataInfo(title,context,typeId,createTime)"+
" Values(@title,@context,@typeId,@createTime)";
OleDbParameter[] ps ={
new OleDbParameter("@title",dataInfo.Title),
//...
};
return DBHelper.ExecuteCommand(sql, ps);
可以正确执行
更新方法1
C# code:
string sql = "Update DataInfo Set title=@title,context=@context,"+
"typeId=@typeId,createTime=@createTime Where id=@id ";
OleDbParameter[] ps ={
new OleDbParameter("@id",dataInfo.Id),
//...
};
return DBHelper.ExecuteCommand(sql, ps);
不能正确执行
更新方法2
C# code:
string sql = "Update DataInfo Set title='" + dataInfo.Title +
相关问答:
ACCESS数据库中有一个tablename表,设计如下
编号,书名,作者,出版时间,出版社,ISBN,目录,简介
其中除“编号”为自动编号外,其它都为“备注”
其中"编号"维一,在“ISBN”中有的为空值, ......
txt 和XML 格式相应
不借助DataSet
导入读取TXT文件
然后直接写入XML(同一文件,不同数据,递增原数据没有被覆盖情况下增加数据.)
教个要点或最好是有个代码提示的
过路好汉 帮个忙撒^^
不会,帮楼主 ......
以下是一段JavsScript脚本,但运行时总会产生 “Microsoft JScript 运行时错误: 'null' 为空或不是对象”异常,大家帮看一下。
<form id="form1" runat="server">
< ......
关于SQL Server Mobile Edition
用Microsoft SQL Server2005 Management Studio Express9.00.3042.00创建SQLCE数据库sqlmobile.sdf
在mobile系统终端上用SQL Server Mobile Edition3.0能查看sqlmobile.sdf里表数据 ......