无效的列名. [英] invalid column name .

查看:182
本文介绍了无效的列名.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我正在现有表中创建列,例如mail_customer,mail_coordinator
它保存在表中
但是当我在asp.net中写查询时
并尝试将数据插入那些文件
错误异常表明无效的列名
是sqlclient.sqlexception错误

我不知道显示它的原因
我尝试创建新表并在此之后插入数据
它显示具有相同异常的无效表名

这个
的解决方案是什么 为什么没有获得名称和表格
我已经输入了确切的名称和语法

告诉我

我正在使用varchar数据类型保存电子邮件id

hello every one
i am creating the column in existing table like mail_customer , mail_coordinator
it is saved in table
but when i write query in asp.net
and try to insert he data in those file
the error exception shows that invalid column name
it is sqlclient.sqlexception error

i don''t know the reason why it is shows
i try creating the new table and insert the data after that also
it is showing the invalid table name with same exception

what is the solution on this
why it is not getting the name and table
i have enter the exact name and syntax

tell me please

i am using the varchar data type for saving the email id

推荐答案

尝试使用Server Explorer窗格在Visual Studio中建立连接:
1)打开服务器资源管理器.
2)右键单击数据连接",然后选择添加连接"
3)在随后的对话框中,选择您的数据源和数据库,指定安全信息,然后按测试连接"按钮.
4)连接正常后,按确定"
5)现在查看数据库,并检查表-您的列在那里吗?如果不是,则您的数据库错误,需要其他连接.
5)在服务器资源管理器"窗格中突出显示您的数据库,然后查看属性"窗格.将显示一个连接字符串的工作示例,您可以将其复制并粘贴到您的应用程序或配置文件中.

将连接字符串与您使用的连接字符串进行比较-当匹配时,它就可以正常工作.
Try setting up a connection in Visual Studio with the Server Explorer pane:
1) Open Server Explorer.
2) Right click "Data connections" and select "Add connection"
3) In the dialog that follows, select your DataSource, and database, specify the security info, and press the "Test connection" button.
4) When the connection works, press "OK"
5) Now look at the database, and examine the tables - are your columns there? If they aren''t, then you have the wrong database, and need a different connection.
5) Highlight your database in the Server Explorer pane, and look at the Properties pane. A working example of the connection string will be shown, which you can copy and paste into your app or config file.

Compare that connection string with the one you are using - when it matches then it should all work.



首先,如果要使用Linq,请确保使用它,如果不正确,请确保更新DBML(DATACONTEXT),您必须检查连接字符串,甚至还要检查插入语句
最好的问候
米特瓦里(M.Mitwalli)
Hi ,
First are you using Linq if it yes make sure to update your DBML (DATACONTEXT)if it no well you have to check your connection string and even check your insert statement
Best Regards
M.Mitwalli


这篇关于无效的列名.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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