将varchar值'1234/2011'转换为数据类型int时,转换失败. [英] Conversion failed when converting the varchar value '1234/2011' to data type int.

查看:68
本文介绍了将varchar值'1234/2011'转换为数据类型int时,转换失败.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SqlDataAdapter da = new SqlDataAdapter(query, conn);
            da.Fill(ds);//here the error "Conversion failed when converting the varchar value '1234/2011' to data type int."



1234/2011这是我的输入值,并用varchar数据类型保存,但是当我们在该时间调用该值时,错误就来了,我明白请发送此消息的原因以及如何解决此问题.

我的电子邮件ID [已删除电子邮件地址].
编辑-[每当有人发布问题解决方案时,您都会收到通知电子邮件.].



1234/2011 this is my input values and saved with varchar datatypes but when we call this values that time the error come i am understand plz send why this came and how solve this problem.

My email id [Email Address Removed].
Edit - [You will get notification email whenever someone post Solution to your Question.].

推荐答案

很明显,该值正试图转换为诠释您是否已将数据集中的列定义为int?

没有看到您正在使用的查询,或者您尝试填充的数据表,就说不完了.
It is really quite clear, the value is trying to be converted to an int. Have you defined the column in the dataset as an int?

Without seeing the query you are using, or the datatable you are trying to fill there isn''t much more that can be said.


这篇关于将varchar值'1234/2011'转换为数据类型int时,转换失败.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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