我的程序在本机上不报错,但是放在台湾的服务器上就会报错 报错是 char转datetime出现错误! 不知道啥子原因! 台湾机子都是繁体字! 有没人能指点下
解决方案 »
- 求c#按需求分配的算法
- 使用forms验证后,根目录下的某一文件夹内的网页怎么调用根目录下其他文件夹内的图片CSS等资源
- |zyciis| 服务器控件已经有像Repeater的格式了,那如何进行数据绑定呢?,谢谢
- 求ASP.NET访问数据库的公用方法
- asp.net开发
- 问一个SQL语句怎么写?
- 如何记录文章的点击数
- 找高手长期合作啊
- 实在是受不了了
- 这行这句话时<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>报
- 求助:关于iframe自适应页面高度的问题
- 请问GridView里HeaderText的值如何进行动态绑定,急
===============
查看一下数据库,里面的字段datetime是不是有不是时间格式的字符串在里面了
{
string sql = "select * from Users where id=" + Class.Get_Cookie("User_ID");
DataTable dt = new SQL().SetDelete(sql).Tables[0];
if (dt.Rows.Count > 0)
{
Label2.Text = dt.Rows[0]["vmoney"].ToString();
}
if (!IsPostBack)
{
bound();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text.Trim() != "")
{
try
{
string sql = "select * from xuniM where ispay=0 and uid=" + Class.Get_Cookie("User_ID");
DataTable dt = new SQL().SetDelete(sql).Tables[0];
if (dt.Rows.Count > 0)
{
Class.SetClue_URL("申請為批復,請不要重複申請", "", 0);
}
else
{
int m = Convert.ToInt32(TextBox1.Text.Trim());
sql = "insert into xuniM values(" + Class.Get_Cookie("User_ID") + ",'" + m + "',0,'1990-06-22')";
new SQL().UpDelete(sql);
Class.SetClue_URL("申請成功,請等待回覆", "", 0);
}
}
catch (Exception)
{ Class.SetClue_URL("請正確填寫充值金額", "", 0);
} }
}
public void bound()
{
try
{
string sql = "select * from xuniM where ispay=1 and uid=" + Class.Get_Cookie("User_ID");
if (TextBox2.Text.Trim() != "")
{
sql += " and dateSuc>='" + Convert.ToDateTime(TextBox2.Text) + "'";
}
else
{
sql += " and dateSuc>='" + Convert.ToDateTime(DateTime.Now.ToShortDateString()) + "'";
}
DataSet ds = new SQL().SetDelete(sql);
dlUser.DataSource = ds;
dlUser.DataBind();
}
catch (Exception)
{ Class.SetClue_URL("发生错误","",0);
}
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
bound();
}
{
string sql = "select * from Users where id=" + Class.Get_Cookie("User_ID");
DataTable dt = new SQL().SetDelete(sql).Tables[0];
if (dt.Rows.Count > 0)
{
Label2.Text = dt.Rows[0]["vmoney"].ToString();
}
if (!IsPostBack)
{
bound();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text.Trim() != "")
{
try
{
string sql = "select * from xuniM where ispay=0 and uid=" + Class.Get_Cookie("User_ID");
DataTable dt = new SQL().SetDelete(sql).Tables[0];
if (dt.Rows.Count > 0)
{
Class.SetClue_URL("申請為批復,請不要重複申請", "", 0);
}
else
{
int m = Convert.ToInt32(TextBox1.Text.Trim());
sql = "insert into xuniM values(" + Class.Get_Cookie("User_ID") + ",'" + m + "',0,'1990-06-22')";
new SQL().UpDelete(sql);
Class.SetClue_URL("申請成功,請等待回覆", "", 0);
}
}
catch (Exception)
{ Class.SetClue_URL("請正確填寫充值金額", "", 0);
} }
}
public void bound()
{
try
{
string sql = "select * from xuniM where ispay=1 and uid=" + Class.Get_Cookie("User_ID");
if (TextBox2.Text.Trim() != "")
{
sql += " and dateSuc>='" + Convert.ToDateTime(TextBox2.Text) + "'";
}
else
{
sql += " and dateSuc>='" + Convert.ToDateTime(DateTime.Now.ToShortDateString()) + "'";
}
DataSet ds = new SQL().SetDelete(sql);
dlUser.DataSource = ds;
dlUser.DataBind();
}
catch (Exception)
{ Class.SetClue_URL("发生错误","",0);
}
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
bound();
}
Convert.ToDateTime(TextBox2.Text).ToString("yyyy-MM-dd HH:mm:ss")