如标题,我数据库里的日期是2008-10-29在修改信息时读出来的却是:1900-1-1 0:00:00
我的修改代码:
这是修改时间的:
this.TextBox2.Text = access.FindString("select vipstart from userinfos where id="+iid);
我的修改代码:
这是修改时间的:
this.TextBox2.Text = access.FindString("select vipstart from userinfos where id="+iid);
解决方案 »
- .net里form验证成功后跳转到前一个页面
- 测试采集时网站被封杀
- webconfig里设置session失效数据库access
- 想做个windows服务,定时执行asp.net程序。
- ASP.NET 2.0的发布问题。
- html里面 <!--include file="XXX"-->显示不正确,什么原因?
- 注销界面中,如何让cookie的数据消失!在线等!
- 如何将Dataset中的某个表的某一列值作为Dropdownlist的items的值?
- datagrid能否整列编辑?
- 递归遍历集合
- 一般.net程序中使用什么orm框架,并请评价一下grove orm
- 导入的excel文件sheet名称不是sheet1就无法读取???
看下是不是NULL
this.TextBox2.Text = access.FindString("select vipstart from userinfos where id="+iid)].ToShortDateString();
[/code
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
try
{
conn.Open();
SqlCommand sqlcmd = new SqlCommand(sql,conn);
string hang = Convert.ToString(sqlcmd.ExecuteScalar());
return hang;
}
catch (Exception e)
{
throw new Exception(e.Message); }
finally
{
conn.Close();
} }
看看他的值是什么
还有
select vipstart from userinfos where id="+iid 结果集是什么
红色部分是否打错了
你可能是SQL有错误
看下是不是NULL