我想当 this.birthday = DateTime.MinValue 时不要插入MinValue,而是插入时保持该字段为空怎样才行? command.Parameters.Add("@Birthday", OleDbType.Date).Value = this.birthday;我想当 this.birthday = DateTime.MinValue 时不要插入MinValue,而是插入时保持该字段为空怎样才行? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if ( this.birthday != DateTime.MinValue ){command.Parameters.Add("@Birthday", OleDbType.Date).Value = this.birthday;} string sqlInsert = "insert into MyTable (Birthday) values (@Birthday)"OleDbConnection connection = Data.GetOleDbConnection();OleDbCommand command = new OleDbCommand(sqlInsert, connection);if ( this.birthday != DateTime.MinValue ) { command.Parameters.Add("@Birthday", OleDbType.Date).Value =this.birthday;}/* * 如果这样就提示参数没有值 * 我想当this.birthday = DateTime.MinValue时也插入一条但记录,没没有值显示出来。用连接字符串时可以用insert MyTable values (null) */ ASP.net 错误处理 图片等比压缩图片? 新建文件夹 Replace()请看一下 login 控件,登录成功后 用户数据存在哪里?cookie?session? 数据绑定的问题 请问如何实现以下格式? SqlDataReader问题? 下拉条绑定数据库信息+无刷新change事件--求助 用制作水晶报表画表格时"详细资料节"在设成多栏的情况下为什么总是会出现---线延伸到表外的情况,我真是没辙了. 谁会写Web Form Control,哪里有比较好的例子。 一个关于留言本的问题,请大家帮忙^o^!!!
{
command.Parameters.Add("@Birthday", OleDbType.Date).Value = this.birthday;
}
OleDbConnection connection = Data.GetOleDbConnection();
OleDbCommand command = new OleDbCommand(sqlInsert, connection);
if ( this.birthday != DateTime.MinValue ) {
command.Parameters.Add("@Birthday", OleDbType.Date).Value =this.birthday;
}
/*
* 如果这样就提示参数没有值
* 我想当this.birthday = DateTime.MinValue时也插入一条但记录,没没有值显示出来。用连接字符串时可以用insert MyTable values (null) */