Failed To Convert Parameter value from a String to boolean. ASP VB

Southern_Gentleman
Southern_Gentleman used Ask the Experts™
on
I simply created a stored procedure that inserts data from an ASP page. I keep getting an error message "Failed to convert parameter value from a string to a boolean".
 
My Stored Procedure is
ALTER PROCEDURE [Merch].[MyStoredProcedure]
	@Suppint Varchar(50),
	@VendorCode Varchar(10),
	@classgroupAllocID Varchar(10),
	@Season Varchar(4),
	@quarter Varchar(50),
	@Month Varchar(50),
	@DateAllocated Date,
	@StyleCreated Varchar(5),
	@EDIT BIT,
	@Category VARCHAR(50)
	
AS
BEGIN
	SET NOCOUNT ON;
	DECLARE @POID INT;
	INSERT INTO [Merch].[PurchasOrder] (Suppint,VendorCode,classgroupAllocID,Season,[quarter],CreateDate)
	VALUES (@Suppint,@VendorCode,@classgroupAllocID,@Season,@quarter,GETDATE());
	Select @POID = SCOPE_IDENTITY();
	
	INSERT INTO [Merch].[purchasOrder2](POID,[Month],DateAllocated,StyleCreated,EDIT,Category,CreatDate) VALUES (@POID,@Month,@DateAllocated,@StyleCreated,@EDIT,@Category);

Open in new window


My vb code to take my web page objects into my sql server is the following.
        Dim strConnString As String = ConfigurationManager.ConnectionStrings("MerchData").ConnectionString
        Dim con As New SqlConnection(strConnString)
        Dim cmd As New SqlCommand()
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "[Merch].[MyStoredProcedure]"
        cmd.Parameters.Add("@Suppint", SqlDbType.VarChar).Value = ddlSupplier.Text.Trim()
        cmd.Parameters.Add("@VendorCode", SqlDbType.VarChar).Value = tbsuppliercode.Text.Trim()
        cmd.Parameters.Add("@classgroupAllocID", SqlDbType.VarChar).Value = ddlclass.Text.Trim()
        cmd.Parameters.Add("@Season", SqlDbType.VarChar).Value = ddlSeason.Text.Trim()
        cmd.Parameters.Add("@quarter", SqlDbType.VarChar).Value = ddlquarter.Text.Trim()
        cmd.Parameters.Add("@Month", SqlDbType.VarChar).Value = ddlMonth.Text.Trim()
        cmd.Parameters.Add("@DateAllocated", SqlDbType.Date).Value = txtDateAllocated.Text.Trim()
        cmd.Parameters.Add("@StyleCreated", SqlDbType.VarChar).Value = ddlStyleCreated.Text.Trim()
        cmd.Parameters.Add("@EDIT", SqlDbType.Bit).Value = ChkEdit.Text.Trim()
        cmd.Parameters.Add("@Category", SqlDbType.VarChar).Value = ddlCategory.Text.Trim()

        cmd.Connection = con
        Try
            con.Open()
            cmd.ExecuteNonQuery()
            lblMessage.Text = "Saved"
        Catch ex As Exception
            Throw ex
        Finally
            con.Close()
            con.Dispose()
        End Try

Open in new window


My boolean statement is on line 14 of the vb code.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior .Net Consultant
Top Expert 2016
Commented:
have you tried:
cmd.Parameters.Add("@EDIT", SqlDbType.Bit).Value = if(ChkEdit.Checked, 1,0)

Open in new window

Author

Commented:
Simple enough, great response time. Thanks for the quick answer.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial