USE [MyWebsite] GO /****** Object: StoredProcedure [dbo].[DeletUserFromAdmin] Script Date: 3/21/2013 7:54:08 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER proc [dbo].[DeletUserFromAdmin] @userid int as DELETE FROM [dbo].[Users] WHERE usr_Id in (@userid)
protected void Button1_Click(object sender, EventArgs e) { string id = "0"; foreach (GridDataItem mm in grdAllUsers.Items) { if (mm.Selected) { id +="," + mm.GetDataKeyValue("usr_Id"); Literal1.Text = id; } } Admin delet = new Admin(); string req = delet.DeleteUserFromAdmin(id); id = string.Empty; LoadGridAllUsers(); Literal1.Text += "REquest:" + req; } SqlCommand cmd = new SqlCommand("DeletUserFromAdmin", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@userid", SqlDbType.Int).Value = id; try { if (con.State == ConnectionState.Closed) { con.Open(); } if (cmd.ExecuteNonQuery() > 0) { return "Succ"; } else { return "UnSucc"; } } catch(Exception ex) { return ex.Message; } finally { con.Close(); } }
string id = "0";
cmd.Parameters.Add("@userid", SqlDbType.Int).Value = id;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)