操作数类型冲突:文本与日期不兼容 [英] Operand type clash: text is incompatible with date

查看:202
本文介绍了操作数类型冲突:文本与日期不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表中有date列作为日期
当我向其中插入数据时.它给出错误:-操作数类型冲突:文本与日期不兼容.
我需要在表中以dd/MM/yyyy格式输入值.
怎么做
Thanks

I have date column as date in my table
When I insert data into it. It gives erro :-- Operand type clash: text is incompatible with date.
I need to enter value into table in dd/MM/yyyy formate.
How to do it
thanks

推荐答案

在插入之前将其转换为DateTime:
Convert it to a DateTime before inserting it:
DateTime dt = DateTime.ParseExact("21/07/2012", "dd/MM/yyyy", CultureInfo.InvariantCulture);


这篇关于操作数类型冲突:文本与日期不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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