J
Jeff
ASP.NET 2.0
This stored procedure fails because the variable type contains a number.
I've debugged the SP in VS2005 and it works if I change the 0/1 value of
type to true/false... How should I fix this?? I cannot just replace type
with the phrase "false" or "true"... maybe using SqlDbType.Bit is wrong
This is header of this SP:
ALTER PROCEDURE dbo.DeleteMessage @id uniqueidentifier, @user int, @type
bit
Here is the ASP.NET code
public override void DeleteMessage(System.Guid id, int user, Boolean type)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("SendMessage", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@id", SqlDbType.UniqueIdentifier).Value = id;
cmd.Parameters.Add("@user", SqlDbType.Int).Value = user;
cmd.Parameters.Add("@type", SqlDbType.Bit).Value = type;
}
}
any suggetions?
Jeff
This stored procedure fails because the variable type contains a number.
I've debugged the SP in VS2005 and it works if I change the 0/1 value of
type to true/false... How should I fix this?? I cannot just replace type
with the phrase "false" or "true"... maybe using SqlDbType.Bit is wrong
This is header of this SP:
ALTER PROCEDURE dbo.DeleteMessage @id uniqueidentifier, @user int, @type
bit
Here is the ASP.NET code
public override void DeleteMessage(System.Guid id, int user, Boolean type)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("SendMessage", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@id", SqlDbType.UniqueIdentifier).Value = id;
cmd.Parameters.Add("@user", SqlDbType.Int).Value = user;
cmd.Parameters.Add("@type", SqlDbType.Bit).Value = type;
}
}
any suggetions?
Jeff