如何通过Application允许SQl中的null值 [英] How to allow the null value in the SQl through the Application

查看:55
本文介绍了如何通过Application允许SQl中的null值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过Application .Hi在SQl中允许空值我只在数据网格视图中导入excel文件。在具有日期和时间格式的记录的excel文件中,如果任何记录单元格为空如何保存记录,而我保存记录则显示错误字符串未被识别为有效日期时间

解决方案

使用DBNull.Value。这将在需要的地方插入空值。


在页面中你检查条件



  if (excel_col ==   NULL
// passignnull作为该列中的参数


How to allow the null value in the SQl through the Application .Hi all I import the excel file in data grid view. In the excel file having Records in date and time format, if any cell of record is null how to save the record, while I am save the record it’s showing the Error "String was not recognized as a valid Date Time"

解决方案

Use DBNull.Value. This will insert the null value wherever required.


In page wise you check the condition

if(excel_col == "NULL")
   // passign "null" as a parameter in that column


这篇关于如何通过Application允许SQl中的null值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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