Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 错误:System.Data.SqlClient.SqlException(0x80131904):转换nvarchar值时转换失败_C#_Html - Fatal编程技术网

C# 错误:System.Data.SqlClient.SqlException(0x80131904):转换nvarchar值时转换失败

C# 错误:System.Data.SqlClient.SqlException(0x80131904):转换nvarchar值时转换失败,c#,html,C#,Html,错误:System.Data.SqlClient.SqlException(0x80131904):将nvarchar值“ff”转换为System.Data.SqlClient.SqlConnection.OnError处的数据类型int.时,转换失败。System.Data.SqlClient.SqlInternalConnection.OnError处的OnError(SqlException异常,Boolean breakConnection,Action1 wrapCloseInActi

错误:System.Data.SqlClient.SqlException(0x80131904):将nvarchar值“ff”转换为System.Data.SqlClient.SqlConnection.OnError处的数据类型int.时,转换失败。System.Data.SqlClient.SqlInternalConnection.OnError处的OnError(SqlException异常,Boolean breakConnection,Action
1 wrapCloseInAction)System.Data.SqlClient.TdsParser.ThroweException和System.Data.SqlClient.TdsParser.TryRun上的警告(TdsParserStateObject stateObj、布尔调用连接锁、布尔异步关闭)中的(SqlException异常、布尔断开连接、操作在System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior RunBehavior,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject StateObject,Boolean和dataReady)中的System.Data.SqlClient.SqlCommand.RunExecuteReader(SqlDataReader ds,RunBehavior RunBehavior,String ResetOptionString)(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、Boolean async、Int32超时、任务和任务、Boolean asyncWrite)位于System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、String方法、TaskCompletionSource
1 completion、Int32超时、任务和任务、Boolean asyncWrite)位于System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource
1 completion,String methodName,Boolean sendToPipe,Int32超时,Boolean asyncWrite)在MyApp.WebForm1.Button1的System.Data.SqlClient.SqlCommand.ExecuteOnQuery()中单击(对象发送方,事件参数e)在C:\myProjectFiles\MyApp\MyApp\Registration.aspx.cs中:第48行客户端连接ID:a7f5710d-3f9e-4cd9-bf01-49ad3fd8cec4

正如您的错误所说,SQL查询中的转换失败。如果不查看查询,很难说出问题在查询中的位置。

您需要紧急阅读(并接受!!)
Conversion failed when converting the nvarchar value 'ff' to data type int.