Tom Knowlton
asked on
C# code behind - how do you call a Stored Procedure?
In C#, how do you create parameters and call a Stored Procedure?
Resource_Add 'eric','eric bills','eric@uwinfinancial .com',1
ALTER PROCEDURE [dbo].[Resource_Add]
@ResourceName nvarchar(64), -- name of the resource
@ResourceDesc ntext, -- optional description of the resource
@ResourceEmail nvarchar(64), -- optional e-mail contact information
@EnableEmailReminders int -- indicates preference to receive reminder
-- notification by e-mail (REN only)
...
...
Resource_Add 'eric','eric bills','eric@uwinfinancial
ALTER PROCEDURE [dbo].[Resource_Add]
@ResourceName nvarchar(64), -- name of the resource
@ResourceDesc ntext, -- optional description of the resource
@ResourceEmail nvarchar(64), -- optional e-mail contact information
@EnableEmailReminders int -- indicates preference to receive reminder
-- notification by e-mail (REN only)
...
...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
string fullConnString = CommonFunctions.ReturnConn
SqlConnection sqlconn = new SqlConnection(fullConnStri
sqlconn.Open();
SqlCommand sqlcomm = new SqlCommand("Resource_Add",
sqlcomm.CommandType = CommandType.StoredProcedur
SqlParameter sqlparameter = new SqlParameter("@ResourceNam
SqlParameter sqlparameter2 = new SqlParameter("@ResourceDes
SqlParameter sqlparameter3 = new SqlParameter("@ResourceEma
SqlParameter sqlparameter4 = new SqlParameter("@EnableEmail
//sqlparameter2.Direction = ParameterDirection.Output
sqlcomm.Parameters.Add(sql
sqlcomm.Parameters.Add(sql
sqlcomm.Parameters.Add(sql
sqlcomm.Parameters.Add(sql
sqlcomm.ExecuteNonQuery();