sos-数据库的问题(给分)
//为什么插入不进去,应该没有问题的???????
[WebMethod]
public int InsertCustomer(string customerName,string customerAdd,string mailID,int classID,string xuqiou,string fadinren,string weituoren,string telephone,string chuanzhen,string bank,string zhanghao,string suihao,string addressID )
{
int retNum=0;
string insertText ="(" +customerName+","+customerAdd+","+mailID+","+classID+","+xuqiou+","+fadinren+","+weituoren+","+telephone+","+chuanzhen+","+bank+","+zhanghao+","+suihao+","+addressID+")";
string sqlInsertCustomer ="INSERT INTO 客户表 (客户名称,地址,邮编,工号,需求,法定人,委托人,电话,传真,银行,帐号,税号,地区ID) VALUES"+insertText;
try
{
dataSet11.AcceptChanges();
sqlConnection2.Open();
//插入客户语句
//sqlInsertCommand2 = new SqlCommand(sqlInsertCustomer,sqlConnection2);
//retNum =sqlInsertCommand2.ExecuteNonQuery();
sqlDataAdapter2.InsertCommand.CommandText=sqlInsertCustomer;
sqlInsertCommand2.ExecuteNonQuery();
//return retNum;
dataSet11.Clear();
}
catch
{
}
finally
{
sqlConnection2.Close();
}
return retNum;
}