62,046
社区成员
发帖
与我相关
我的任务
分享
private static int ConvertStringToInteger(string s)
{
int result = 0;
int.TryParse(s, out result);
return result;
}
//C#向数据库提供数据时 整型数据不需要加单引号
string strSql = "insert into book (bookname,typeid,write,chubanshename,bookprice,xiancunnumber) values('" + txtBookName.Value + "'," + Convert.ToInt32(ddlType.SelectedValue.Trim()) + ",'" + txtWrite + "','" + txtChuban.Value + "'," + Convert.ToInt32(txtBookPrice.Value.Trim()) + "," +Convert.ToInt32(txtBookCount.Value.Trim()) + ")";