I’m getting the following error when trying to save a NVarChar field with a maximum size greater than 2000 although the maximum for SQL Server 2005 is 4000.
In the code that caused the error al_UserNote was configured as nvarchar(2048). Looking at the partial class it looks like field lengths are being doubled by BOMapper when it creates the class. If you use NVarChar(MAX) there is no error since the length is set to -1.
-Larry
MicroFour.StrataFrame.Data.DataLayerSavingException was unhandled by user code
Message="The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 11 ("@al_UserNote"): Data type 0xE7 has an invalid data length or metadata length."
Source="MicroFour StrataFrame Business"
StackTrace:
at MicroFour.StrataFrame.Business.BusinessLayer.Save(Boolean Transactional, String TransactionKey)
at MicroFour.StrataFrame.Business.BusinessLayer.Save()
at WindowsForms.CoverSheet.SaveAllOnTransaction() in C:\HRADevelopment-SFv1.5\ScanTracker\WindowsForms\CoverSheet.vb:line 188
at WindowsForms.CoverSheet.btnPrint_Click(Object sender, EventArgs e) in C:\HRADevelopment-SFv1.5\ScanTracker\WindowsForms\CoverSheet.vb:line 118
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)