数据插入问题 [英] data insert problem

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

问题描述

你好,





表中共有10个字段(访问)。每当我将文本框留空时它就会出错(条件表达式中的数据类型不匹配)。



如何解决它。

解决方案

您的问题没有提供足够的信息来完全回答这个问题。



但是,当您插入错误的数据类型时会发生此错误例如,一列 int datetime 字段等。


的手机号码,你应该给...比如..



在SQL中你需要创建列为varchar数据类型



要在C#中访问该值,请取string变量


Hai



尝试检查没有必须插入的字段,可能是你有10个字段,但你尝试只插入9个值,所以它给出错误,检查插入查询,粘贴你在这里插入查询,然后轻松找到错误。



如果你插入整数给出单个qutos,如果是字符串给双重quots。





为什么你留空文本框?你试图插入空值,所以它给出了错误。所以更改访问表中的列,如选择列,并在每列中给否为否,可能是数字列不能给出空值,所以将其作为必填字段。

hi there,


there is total 10 field in table(access). whenever i leave textbox blank it gives error ("datatype mismatch in criteria expression").

how can i solve it.

解决方案

Your question does not provide enough information to answer the question completely.

However, this error occurs when you are inserting the wrong data type in a column for e.g. int in a datetime field etc.


for mobile number ,You should given like..

In SQL you need to create the column as "varchar" datatype

To access that value in C# take "string" variable


Hai

Try to check no of fields u have to insert,may be u have 10 fields but u try to insert only 9 values so it gives error,check insert query,paste ur insert query here ,then find error easily.

And if u insert integer give single qutos ,if it is string give double quots.


Why u leave empty text box ? u try to insert empty values so it gives error.so change the column in a access table like select column and give "Required" as No in each column,may be for number column cant give empty value,so make it as mandatory field.


这篇关于数据插入问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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