连接属性尚未初始化? [英] Connection property has not been initialized??
问题描述
单击提交时出现以下错误,有人知道为什么会这样吗?
I'm getting the following error when I click submit, does anyone know why this is happening?
System.InvalidOperationExceptio
cmd.ExecuteNonQuery()在错误消息中突出显示...
System.InvalidOperationExceptio
cmd.ExecuteNonQuery() is highlighted in the error message...
推荐答案
您尚未设置命令对象的连接属性.
you have not set the connection property of the command object.
类似这样的东西.
System.Data.OleDb. OleDbCommand o = 新建 System.Data.OleDb. OleDbCommand () ;
System.Data.OleDb.OleDbCommand o = new System.Data.OleDb.OleDbCommand();
//o.Connection////将您创建的连接设置为命令的连接属性
// o.Connection // set the connection that u have created to the connection property of your command
对象.
希望这会有所帮助.
此致
Nasha
这篇关于连接属性尚未初始化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!