2013-07-06 54 views
0

插入數據到SQL Server數據庫時,我得到了以下異常。SQLEXCEPTION上存儲數據到SQL Server

System.Data.SqlClient.SqlException:字符串或二進制數據將被截斷。
該聲明已被終止。
在System.Data.SqlClient.SqlConnection.OnError(SqlException異常,布爾breakConnection)
在System.Data.SqlClient.SqlInternalConnection.OnError(SqlException異常,布爾breakConnection)
在System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning (TdsParserStateObject stateObj)
在System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand的cmdHandler,SqlDataReader的數據流,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)
在System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader的DS,RunBehavior runBehavior ,字符串resetOptionsString)
在System.Data.SqlClient.SqlComm and.RunExecuteReaderTds(的CommandBehavior cmdBehavior,RunBehavior runBehavior,布爾returnStream,布爾異步)
在System.Data.SqlClient.SqlCommand.RunExecuteReader(的CommandBehavior cmdBehavior,RunBehavior runBehavior,布爾returnStream,字符串方法,DbAsyncResult結果)
在System.Data .SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult結果,字符串方法名,布爾sendToPipe)
在System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
在SubjectDataAccess.InsertUrls(字符串URL,字符串urltitle,字符串urldetails,字符串圖標,字符串圖象 - )在d:\項目\新建文件夾\ 3月5日\ 3月5日\ ProfileTenModified \ App_Code文件\ SubjectsDataAccessLayer \ SubjectDataAccess.cs:行723}

的數據是

網址:

http://www.mnn.com/earth-matters/space/photos/10-places-on-earth-that-resemble-alien-planets/etosha-pan-namibia 

標題:

10 places on Earth that resemble alien planets: Etosha pan, Namibia 

做的10是在開始的時候會引起問題...

+2

表格列的大小是多少? – MEYWD

+0

我有,如果你使用的是一個 –

+0

怎麼樣的參數?????????? – MEYWD

回答

1

確保該數據小於表格上的數據大小

相關問題