there is a difference, OleDb is position oriented, not name oriented:this.oleDbInsertCommand1.CommandText = "INSERT INTO Authors(firstName, lastName) VALUES (?,?)";oleDbDataAdapter1.InsertCommand.Parameters.Add("@name1","first");
oleDbDataAdapter1.InsertCommand.Parameters.Add("@name2","second");the first ? will get the value "first", the second ? will get the value "second", the name "@name1" and "@name2" are irrelevant
oleDbDataAdapter1.InsertCommand.Parameters.Add("@name2","second");the first ? will get the value "first", the second ? will get the value "second", the name "@name1" and "@name2" are irrelevant
解决方案 »
- web网站可以接受GPRS发送的数据不?
- 窗口Hide后,为什么响应不了全局快捷键了?
- 急!急!各位前辈,谁有用过ZedGraph.Web.dll请通知一下本姑娘,有个问题请教一下,谢谢!
- 正则表达式问题关于逻辑或
- BYTE类型如何转换成IMAGE类型?
- 自己拼写的table怎么实现excel汇出功能。代码如下,本人对汇出是第一次做,求高手指点,不胜感激
- 为什么我运行窗口(非控制台)程序,后面总是有个控制台显示出来
- 调用线程必须是sta
- 这样做有什么好处?
- 怎样把dotnetfx做到安装程序里?
- 这样报表用什么方式处理
- winform:datagrid我要列抬头文字居中。而列内容的文字靠右。如何实现?
"UPDATE Categories Set Description = @CatDescription" +
"WHERE CategoryName = @CatName";SqlCommand cmd = new SqlCommand(UpdateQuery);
cmd.Parameters.Add("@CatName","Dairy Porducts");
cmd.Parameters.Add("@CatDescription","Milk");...为什么这个参数加入的顺序就和sql语句中的顺序不同呢?是因为是Sql Server的数据源,不是OleDb的数据源吗?
如果是这个原因,那么为什么微软不把他们弄成一样的呢?