小编skm*_*skm的帖子

.Net紧凑框架SqlClient异常

我为Windows CE 5.0设备开发,我正在尝试连接到远程SQL Server.但是,如果我使用带参数的命令,我会得到异常:

{System.Data.SqlClient.SqlException: SqlException
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, TdsParserState state)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior run, SqlCommand cmdHandler, SqlDataReader dataStream)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at Test.MainForm.TestConnection()
...
}
Run Code Online (Sandbox Code Playgroud)

码:

SqlConnection conn = new SqlConnection(connectionString); …
Run Code Online (Sandbox Code Playgroud)

c# compact-framework exception sqlclient windows-ce

3
推荐指数
1
解决办法
889
查看次数

标签 统计

c# ×1

compact-framework ×1

exception ×1

sqlclient ×1

windows-ce ×1