得到了System.Data.Sqlclient.sqlexception和nt处理? [英] Got System.Data.Sqlclient.sqlexception nd which is nt handled?

查看:123
本文介绍了得到了System.Data.Sqlclient.sqlexception和nt处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法绑定多部分标识符textBox1.text。

无法绑定多部分标识符textBox2.text。

The multi-part identifier "textBox1.text" could not be bound.
The multi-part identifier "textBox2.text" could not be bound.

推荐答案

在SQL中,多部分标识符是一种将数据库表与该表中的列强关联的方式: TableNameOrAlias.ColumnName



因此,此错误消息告诉您SQL希望有一个名为 textBox1 的表,另一个名为 textBox2 。鉴于这些名称(及其相关的'.text'字符串)是用户界面表单元素的特征,我怀疑您对如何在应用程序和数据库之间传递数据做出了一些无效的假设。



您需要阅读 SqlCommand 对象以及如何使用它将参数传递给SQL查询。
In SQL, a multi-part identifier is a way of strongly associating a database table with a column in that table: TableNameOrAlias.ColumnName.

This error message is therefore telling you that your SQL expects there to be a table called textBox1, and another called textBox2. Given that those names (and their associated '.text' strings) are characteristic of user-interface form elements, I suspect that you are making some invalid assumptions about how to pass data between your application and the database.

You need to read up about the SqlCommand object and how to use it to pass parameters to a SQL query.


这篇关于得到了System.Data.Sqlclient.sqlexception和nt处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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