关于C#.NET + SQL Server2000 字符串过长的问题

来源:互联网 发布:在手机淘宝买东西流程 编辑:程序博客网 时间:2024/05/16 14:45
  1. 未处理 System.Data.SqlClient.SqlException
  2.   Message="将截断字符串或二进制数据。/r/n语句已终止。"
  3.   Source=".Net SqlClient Data Provider"
  4.   ErrorCode=-2146232060
  5.   Class=16
  6.   LineNumber=1
  7.   Number=8152
  8.   Procedure=""
  9.   Server="(local)"
  10.   State=9
  11.   StackTrace:
  12.        在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
  13.        在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
  14.        在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
  15.        在 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
  16.        在 System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
  17.        在 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
  18.        在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
  19.        在 CRM.BaseClass.BaseOperate.getcom(String M_str_sqlstr) 位置 D:/My Documents/教材资源/c#/mingrisoft/企业客户资源管理系统/CRM/CRM/BaseClass/BaseOperate.cs:行号 34
  20.        在 CRM.PInfoManage.frmEInfoManage.tsbtnSave_Click(Object sender, EventArgs e) 位置 D:/My Documents/教材资源/c#/mingrisoft/企业客户资源管理系统/CRM/CRM/PInfoManage/frmEInfoManage.cs:行号 59
  21.        在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
  22.        在 System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
  23.        在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
  24.        在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
  25.        在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
  26.        在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
  27.        在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
  28.        在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
  29.        在 System.Windows.Forms.Control.WndProc(Message& m)
  30.        在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  31.        在 System.Windows.Forms.ToolStrip.WndProc(Message& m)
  32.        在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  33.        在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  34.        在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  35.        在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
  36.        在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
  37.        在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
  38.        在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
  39.        在 System.Windows.Forms.Application.Run(Form mainForm)
  40.        在 CRM.Program.Main() 位置 D:/My Documents/教材资源/c#/mingrisoft/企业客户资源管理系统/CRM/CRM/Program.cs:行号 17
  41.        在 System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
  42.        在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
  43.        在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  44.        在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  45.        在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  46.        在 System.Threading.ThreadHelper.ThreadStart()
  47. ======================
  48. >   CRM.exe!CRM.BaseClass.BaseOperate.getcom(string M_str_sqlstr = "update tb_Employee set EName='周*朋',ESex='男',EBirthday='1985年12月22日 星期日',EWDate='2006年12月22日 星期五',EDiploma='本科',EDepartment='.NET技术部门',EPosition='普通员工',EType='普通员工' where EID='YG1000001'") 行23 C#

 

 

 

-------------------------

只要把数据库的字符类型的容量设大点就可以了。

原创粉丝点击