Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
stuckne1
Starting Member
22 Posts |
Posted - 2009-06-22 : 13:25:18
|
| USE [FinAid_Report_Form]GO/****** Object: StoredProcedure [dbo].[P_sp_DeleteUser] Script Date: 06/22/2009 11:55:48 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[P_sp_DeleteUser] -- Add the parameters for the stored procedure here @autoIncrementID intASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here Delete From userTable Where autoIncrementID = @autoIncrementIDENDhere is the c# codeI tried it both ways...SqlCommand myDeleteCommand = new SqlCommand("P_sp_DeleteUser", connection);myDeleteCommand.Add("@autoIncrementID", Convert.ToInt32(ListBox1.SelectedValue));myDeleteCommand.ExecuteNonQuery();and tried like these ways toomyDeleteCommand.Add("@autoIncrementID",ListBox1.SelectedValue);myDeleteCommand.AddWithValue("autoIncrementID", ListBox1.SelectedValue);myDeleteCommand.addWithValue("autoIncrementID", Convert.ToInt32(ListBox1.SelectedValue)); |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-22 : 13:31:19
|
| http://support.microsoft.com/kb/320916 |
 |
|
|
stuckne1
Starting Member
22 Posts |
Posted - 2009-06-22 : 15:25:07
|
| Alright I got it. Thanks for the link. |
 |
|
|
|
|
|