There is SQL Server stored procedure with one of the input parameters a uniqueidentifier ...
I tested the sp in SQL Server itself and it works fine ..
However from ASP.NET code when tring to use the sp .. I get the error
Error converting data type varchar to uniqueidentifier
How do I pass the uniqueidentifier (userID) value .. I tried varchar .. but no luck it seems
mDbConn = New SqlConnection(ConnectionString)
mDbConn.Open()
mSqlCmd = New SqlCommand("usp_GetMYsp", mDbConn)
mSqlCmd.CommandType =Data.CommandType.StoredProcedure
mSqlCmd.Parameters.Add("@userID", Data.SqlDbType.VarChar)
mSqlCmd.Parameters("@userID").Value = myVal.ToSTring
mSqlCmd.Parameters.Add("@Field2", Data.SqlDbType.Int)
mSqlCmd.Parameters("@Field2").Value = intEventUserEventRoleID
mSqlDr = mSqlCmd.ExecuteReader()
I tested the sp in SQL Server itself and it works fine ..
However from ASP.NET code when tring to use the sp .. I get the error
Error converting data type varchar to uniqueidentifier
How do I pass the uniqueidentifier (userID) value .. I tried varchar .. but no luck it seems
mDbConn = New SqlConnection(ConnectionString)
mDbConn.Open()
mSqlCmd = New SqlCommand("usp_GetMYsp", mDbConn)
mSqlCmd.CommandType =Data.CommandType.StoredProcedure
mSqlCmd.Parameters.Add("@userID", Data.SqlDbType.VarChar)
mSqlCmd.Parameters("@userID").Value = myVal.ToSTring
mSqlCmd.Parameters.Add("@Field2", Data.SqlDbType.Int)
mSqlCmd.Parameters("@Field2").Value = intEventUserEventRoleID
mSqlDr = mSqlCmd.ExecuteReader()