社区
C#
帖子详情
请问高手一个关于数据库更新的问题
bluefeilin
2006-10-27 04:09:11
我想更新数据库中一个表的一些字段,但是总是出现一个这样的问题,不能将字符型转成datetime型,请问这要怎么做啊
...全文
141
8
打赏
收藏
请问高手一个关于数据库更新的问题
我想更新数据库中一个表的一些字段,但是总是出现一个这样的问题,不能将字符型转成datetime型,请问这要怎么做啊
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
bluefeilin
2006-10-27
打赏
举报
回复
我自己已经解决了
icehawk
2006-10-27
打赏
举报
回复
string selectstr="update shenqing set sname='"+TB_sname.Text+"',xibie='"+TB_xi.Text+"',zhuanye='"+TB_zhuanye.Text+"',shijian=@shijian";
SqlParameter sqldatetime = yourCommand.Parameters.Add( "@ImageValue, SqlDBType.DateTime);
sqldatetime.value = dt;
超越_zww
2006-10-27
打赏
举报
回复
同上.
icehawk
2006-10-27
打赏
举报
回复
string selectstr="update shenqing set sname='"+TB_sname.Text+"',xibie='"+TB_xi.Text+"',zhuanye='"+TB_zhuanye.Text+"',shijian=@shijian";
command.Parameters.Add( new SqlParameter( "@shijian",DBType.DateTime));
冰宇枫
2006-10-27
打赏
举报
回复
DateTime dt = Convert.ToDateTime(TB_shijian.Text);
string selectstr="update shenqing set sname='"+TB_sname.Text+"',xibie='"+TB_xi.Text+"',zhuanye='"+TB_zhuanye.Text+"',shijian='"+ dt +"'";
冰宇枫
2006-10-27
打赏
举报
回复
string strdate = TB_shijian.Text;
DateTime dt = Convert.ToDateTime(strdate);
string selectstr="update shenqing set sname='"+TB_sname.Text+"',xibie='"+TB_xi.Text+"',zhuanye='"+TB_zhuanye.Text+"',shijian='"+dt+"'";
bluefeilin
2006-10-27
打赏
举报
回复
这是我的代码:
string strdate = TB_shijian.Text;
DateTime dt = Convert.ToDateTime(strdate);
string selectstr="update shenqing set sname='"+TB_sname.Text+"',xibie='"+TB_xi.Text+"',zhuanye='"+TB_zhuanye.Text+"',shijian=dt";
出现的错误就是列名dt不存在。
请问要怎么才能把这个变量付给时间这个字段啊。
lxhvc
2006-10-27
打赏
举报
回复
string strdate = "1900-10-1";
DateTime dt = Convert.ToDateTime(strdate);
JavaScript中concat不起作用
JavaScript中concat不起作用 //concat()把两个或者多个数组链接在一起,但是不改变已经存在的数组 //而是返回
一个
链接之后的新数组 var a = [1,2,3]; a.concat([4,5]); console.log(a); //此处输出为 [1, 2, 3] var a = [1,2,3]; a = a.concat([4,5]); console.log...
Weex开发9(相比差异---持续
更新
...)
JS里面获取数组的个数是arr.length 不是count JS里面添加数组是arr.push() 不是arr.add() JS添加键值对直接 arr.key = value js中concat不起作用 concat()把两个或者多个数组链接在一起,但是不改变已经存在的数组,而是返回
一个
链接之后的新数组 ...
nginx concat 模块无法支持js合并
2019独角兽企业重金招聘Python工程师标准>>> ...
JavaScript的concat方法
数组的concat方法 用途: 合并2个或多个数组 变量名 value1,value2,value3,…,valueN 详细描述 值或者数组(可以传对象) 是否必传 否 要注意,concat返回的是
一个
浅拷贝 示例: 1.连接2个数组 const arr = [1, 2, 3].concat([4, 5]) console.log(arr) // [1,2,3,4,5] 2.连接3个数组 const arr1 = [1, 2] const arr2 = [3,
C#
111,128
社区成员
642,533
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章