连接属性尚未初始化? [英] Connection property has not been initialized??

查看:152
本文介绍了连接属性尚未初始化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

单击提交时出现以下错误,有人知道为什么会这样吗?

I'm getting the following error when I click submit, does anyone know why this is happening?

System.InvalidOperationExceptio n:ExecuteNonQuery:连接属性尚未初始化.
cmd.ExecuteNonQuery()在错误消息中突出显示...

System.InvalidOperationException: ExecuteNonQuery: Connection property has not been initialized.
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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆