[WebMethod] [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)] public string Inserttblval(string UserName, int CountryId, int IsActive) { int rowsInserted; SqlConnection conn = new SqlConnection("Data Source=SREENI\\SQLEXPRESS;Initial Catalog=TestDB;User ID=sa;Password=sa123"); string sql = string.Format(@"INSERT INTO [TestDB].[dbo].[Table_1] ([CountryId],[UserName],[IsActive]) VALUES ({0},'{1}',{2})", CountryId,UserName, IsActive); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = sql; cmd.CommandType = CommandType.Text; conn.Open(); rowsInserted = cmd.ExecuteNonQuery(); conn.Close(); cmd = null; return string.Format("CountryId,UserName, IsActive"); }
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
[WebMethod]
[WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string Inserttblval(string UserName, int CountryId, int IsActive) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)