try
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into Books (BooksID,BookName,Edition,AuthorsName,Sort,PublisherName,PubData,Price) values(" + insid + ",'" + insname + "','" + insedition + "','" + inswriter + "','" + inssort + "','" + inspublisher + "','" + inspub + "'," + insprice + ")", con);
cmd.ExecuteNonQuery();
Response.Write("<script>alert('插入成功!');</script>");
}
catch(Exception exp)
{
Response.Write(exp.ToString());
}
finally
{
con.Close();
}
这样看看输出的错误信息是什么..
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into Books (BooksID,BookName,Edition,AuthorsName,Sort,PublisherName,PubData,Price) values(" + insid + ",'" + insname + "','" + insedition + "','" + inswriter + "','" + inssort + "','" + inspublisher + "','" + inspub + "'," + insprice + ")", con);
cmd.ExecuteNonQuery();
Response.Write("<script>alert('插入成功!');</script>");
}
catch(Exception exp)
{
Response.Write(exp.ToString());
}
finally
{
con.Close();
}
这样看看输出的错误信息是什么..
[此贴子已经被作者于2007-1-15 16:47:41编辑过]
飘过~~