SqlDataAdapter CommandText Size limitations ?

From: gerry (germ_at_hotmail.com)
Date: 06/08/04


Date: Tue, 8 Jun 2004 12:22:41 -0400

I have an SqlDataAdapter setup with the following insert command :

insert into SomeTable
([_ID],[ACCOUNT],[DESCRIPTION],[INACTIVE],[LINE_TYPE],[BAL_TYPE],[ACCT_TYPE]
,[SORT_GROUP],[POST_TYPE],[COST_CNTR],[FREIGHT],[PROD_LINE_CD],[TEST_ACCOUNT
]) values
(@_ID,@ACCOUNT,@DESCRIPTION,@INACTIVE,@LINE_TYPE,@BAL_TYPE,@ACCT_TYPE,@SORT_
GROUP,@POST_TYPE,@COST_CNTR,@FREIGHT,@PROD_LINE_CD,@TEST_ACCOUNT)

which generates the following error :

System.Data.SqlClient.SqlException: Prepared statement '(@_ID
nvarchar(11),@ACCOUNT nvarchar(11),@DESCRIPTION nvarchar(3' expects
parameter @LINE_TYPE, which was not supplied.
   at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
   at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)

since I have no problem with this in other tables I am assuming that there
is a maximum length for the prepared statements that is being exceeded
I have not found any documentation either supporting or refuting this
assumption.
At just over 300 bytes this seems like an extremely low limit.

am i wrong in this ? is there a work around ?

any input greatly appreciated.

gerry



Relevant Pages

  • Re: SqlConnection vs IDbConnection
    ... want to use the prepared statement. ... If your command points to a stored procedure, ... and need it prepared by the underlying provider, ... Note, if your command is a stored procedure, you don't want to call ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SqlDataAdapter CommandText Size limitations ?
    ... > I have an SqlDataAdapter setup with the following insert command: ... > I have not found any documentation either supporting or refuting this ...
    (microsoft.public.dotnet.framework.adonet)