ajax向数据库中添加数据,用jqueryajax在数据库中插入数据

时间:2025-03-11 11:12:10

我有一个带有c#(.net4)代码的表单。在这种形式下,用户填写他的规格并提交。

我想在jquery中使用ajax或post方法来预防写流程代码。 “成功”函数执行,但它不工作,任何记录插入数据库;我执行executemember方法工作没有问题,但它不工作与jQuery的是问题吗?用jqueryajax在数据库中插入数据

[WebMethod]

public static string executeinsert(string name ,string family , string username,string password , string email,string tel, string codemeli)

{ string constring = "data source=.;database=site;integrated security=true;";

SqlConnection con = new SqlConnection(constring);

SqlCommand com = new SqlCommand("insertmember", con);

= ;

(new SqlParameter("@username", , 250));

["@username"].Value = username;

(new SqlParameter("@name", SqlDbType.