Hi ,
Check this
CREATE PROCEDURE usp_Delete
(
@UID int ,@FID int =NULL
)
AS
BEGIN
SET NOCOUNT ON;
DELETE FROM TableName WHERE UID=@UID and FID = @FID
END
void Delete(int uid, int? fid)
{
using (
SqlConnection con =
new SqlConnection(ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString))
{
con.Open();
using (SqlCommand cmd = new SqlCommand("usp_Delete", con))
{
cmd.Parameters.AddWithValue("@UID", uid);
cmd.Parameters.AddWithValue("@FID", fid);
cmd.ExecuteNonQuery();
}
}
}
Best Regards
M.Mitwalli