還請版主幫幫忙啊,不勝感激。
改成大写的W后,我正常运行,数据库也能正常插入数据.不知道你的是什么原因了`~~~发你吧`~~我只改动了数据库连接串,表名和列名,其它没变
private void savehistory()
{
string sModel = TextBox1.Text.ToUpper();
string sERP_NO = TextBox2.Text.ToUpper();
SqlConnection conn = new SqlConnection("Persist Security Info=False;User ID=sa;Password=expedia-sow4;Initial Catalog=EDQScriptDB;Data Source=fb-sow-four");
SqlCommand cmd = new SqlCommand("insert into webuserpage(username,pagename) VALUES('" + sModel + "','" + sERP_NO + "')", conn);
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
catch (Exception ee)
{
Response.Write("Fail");
}
finally
{
conn.Close();
}
Response.Write("OK");
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
Response.Write("<script>parent.pb.Button1Complete();parent.ClearTimer();</script>");
savehistory();
}
catch (Exception ex)
{
Response.Redirect("ErrorPage.aspx?ErrorMsg=" + ex.Message + "&ErrorUrl=" + Request.Url.ToString());
}
}
[此贴子已经被作者于2007-8-8 13:37:28编辑过]