Conversion failed when converting the varchar value 'GroupId:' to data type int. 1 CUS |
Conversion failed when converting the varchar value 'GroupId:' to data type int. 1 CUS this is my issue
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
What I have tried:
I tried to change groupid parameter aa string
objCmd.Parameters.AddWithValue("@OnlineAccess", onlineaccess);
objCmd.Parameters.AddWithValue("@ContactId", ContactId);
objCmd.Parameters.AddWithValue("@uid", uid);
objCmd.Parameters.AddWithValue("@UserType", UserType);
objCmd.Parameters.AddWithValue("@OnlineAccessOld", oldonlineaccess);
objCmd.Parameters.AddWithValue("@OldEmail", oldemail);
objCmd.Parameters.AddWithValue("@Microsite",MicrositeId);
objCmd.Parameters.AddWithValue("@UserName", UserName);
objCmd.Parameters.AddWithValue("@OldUserName", OldUserName);
objCmd.Parameters.AddWithValue("@Password", Password);
objCmd.Parameters.AddWithValue("@UserNameFlag", UserNameFlag);
objCmd.CommandText = "ADR_spInsertCustomerContact";
objCmd.ExecuteNonQuery().ToString();
pValue = objCmd.Parameters["@ErrMessage"].Value.ToString() + "-" + objCmd.Parameters["@RHdrID"].Value.ToString();
objConn.Close();
return pValue;
}.
This is my code in this I pass parameters like groupid declared string datatype to this function but in sp I declare groupid as a parameter as int is this a issue or not