A
Alan Pretre
In VS 2003 when I use the Configure Data Adapter option in VS 2003 I get the
size parameter to the SqlParameter set to the correct size for a varchar,
for example,
....
new System.Data.SqlClient.SqlParameter("@SWA_SO_TYPE",
System.Data.SqlDbType.VarChar, 256, "SWA_SO_TYPE"),
whereas in VS 2005, the wizard gives me (0 instead of 256),
....
new System.Data.SqlClient.SqlParameter("@SWA_SO_TYPE",
System.Data.SqlDbType.VarChar, 0, "SWA_SO_TYPE"),
This is showing up now as a bug in production code because I get the
exception:
System.Data.SqlClient.SqlException: String or binary data would be
truncated.
The statement has been terminated.
Source: .Net SqlClient Data Provider
HResult: -2146232060 (0x80131904)
Errors Collection:
-------------------------------------
Class: 16
LineNumber: 1
Message: String or binary data would be truncated.
Number: 8152
Server: MACC2K3012
Source: .Net SqlClient Data Provider
State: 9
-------------------------------------
Class: 0
LineNumber: 1
Message: The statement has been terminated.
Number: 3621
Server: MACC2K3012
Source: .Net SqlClient Data Provider
State: 0
ErrorCode: -2146232060
Can anyone help me? Thanks.
-- Alan
size parameter to the SqlParameter set to the correct size for a varchar,
for example,
....
new System.Data.SqlClient.SqlParameter("@SWA_SO_TYPE",
System.Data.SqlDbType.VarChar, 256, "SWA_SO_TYPE"),
whereas in VS 2005, the wizard gives me (0 instead of 256),
....
new System.Data.SqlClient.SqlParameter("@SWA_SO_TYPE",
System.Data.SqlDbType.VarChar, 0, "SWA_SO_TYPE"),
This is showing up now as a bug in production code because I get the
exception:
System.Data.SqlClient.SqlException: String or binary data would be
truncated.
The statement has been terminated.
Source: .Net SqlClient Data Provider
HResult: -2146232060 (0x80131904)
Errors Collection:
-------------------------------------
Class: 16
LineNumber: 1
Message: String or binary data would be truncated.
Number: 8152
Server: MACC2K3012
Source: .Net SqlClient Data Provider
State: 9
-------------------------------------
Class: 0
LineNumber: 1
Message: The statement has been terminated.
Number: 3621
Server: MACC2K3012
Source: .Net SqlClient Data Provider
State: 0
ErrorCode: -2146232060
Can anyone help me? Thanks.
-- Alan