All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
phpWind中配制伪静态的步骤_[PHP教程]
C#中WebBrower控件应用实例
ASP.NET,2.0,页面状态持续程序实例_.net资料_编程技术
教你安装SQL Server 2005示例数据库_[SQL Server教程]
asp.net2.0网站语法之HTML服务器控件语法
PHP中使用XML-RPC构造Web Service简单入门_[PHP教程]
LINQ体验(7)——LINQ,to,SQL语句之Group,ByHaving和Exists_[Asp.Net教程]
按比例微缩图片的一段小小的JS代码_JavaScript技术_编程技术
c#中DateTime函数的各种显示效果_[Asp.Net教程]
asp.net2.0对DataList数据控件进行绑定
Reading number is top 10 pictures
西班牙山村小景1
In 2013 hercules Arnold classic2
美女就是美女
Fan bingbing black wings for platform and DanLuoWang believes beauty1
The money of more than 100 countries and regions22
So beauty, will let you spray blood2
西班牙山村小景5
Send some Valentine's day cartoon
The wise woman of chest2
The other a successor of sora aoi
Download software ranking
虚拟机汉化软件
Unix video tutorial12
超级战舰
C#高级编程(第4版)
仙剑奇侠传98版歌曲
Proficient in JavaScript
Unix video tutorial14
Tram sex maniac 2 (H) rar bag8
都市狐狸姑娘传
圣殿祭司的ASP.NET.2.0.开发详解-使用C#
aaa published in(发表于) 2013/12/13 9:40:16 Edit(编辑)
asp.net中对数据库表插入null空值的问题_.net资料_编程技术

asp.net中对数据库表插入null空值的问题_.net资料_编程技术

asp.net中对数据库表插入null空值的问题_.net资料_编程技术-你的首页-uuhomepage.com

对表进行插入操作,如datetime和int类型的两个字段,都允许为null,
用“sqlcmd.Parameters.Add("@t12",tb12.Text)”参数绑定时。datetime类型时,tb12.Text为空,插入成功,不报错,查看该值,却为1900-01-01;int类型时,用同样语句,tb12.Text为空,插入成功,不报错,查看该值,却为0;用“sqlcmd.Parameters.Add(new SqlParameter("@t12",SqlDbType.DateTime));sqlcmd.Parameters["@t12"].Value=tb12.Text;”语句时,tb12.Text为空插入则报错。


sqlcmd.Parameters.Add(new SqlParameter("@t12",SqlDbType.DateTime));
if (tb12.Text.Length>0)
{
sqlcmd.Parameters["@t12"].Value=tb12.Text
}
else
{
sqlcmd.Parameters["@t12"].Value = System.DBNull.Value;
}






添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.