Ask a Question related to ASP.NET Web Services, Design and Development.
-
Ágúst #1
Error when updating a long text string
Hi
I have a windows form app which uses a webservice to
update data using datasets. On one occasion the dataset
contains a string value who's length is a little over
32000 characters.
When that happens the web server throws a error:
A severe error occured on the current command. The
result, if any, should be discarded.
Is there a upperbound on how long a string can be sending
it inside a dataset to a webservice. Behind the scenes
there is soap etc., is the origin of the error in there or
what?
Any suggestions warmly welcomed, best regards Ágúst V.
Ágúst Guest
-
How long is a piece of string
I know this is a bit of a how long is piece of string question, but has anyone got any very ball park guides for the number of faces you can have in... -
Long String
Hi I'm sending a long string to a web service like this ... -
Updating a Long VarChar field
Hi, I'm having problems to update a LONG VARCHAR field. Suppose I have a table with two fields (the key field named TheKey, and a long varchar... -
How to replace a long string in a text file?
perlwannabe wrote: From the script under you are just replacing lines with a static line/value. <snip> I don't see any reason to use hex.... -
RAC - how long is a piece of string
g'day folks, No experience with RAC but have been asked to estimate how long it would take to set up a RAC environment of 2 nodes with 2... -
Ágúst #2
Re: Error when updating a long text string
This is the code.
1) From the windows form
2) From the webservice
3) From the stored procedure
1) Here is the code from the windowsform:
--
WS_Verandi_3_0.WS myWS = new WS_Verandi_3_0.WS();
Verandi_3_0_Common.TokenHandler myTH = new
Verandi_3_0_Common.TokenHandler( CodeConstants.C_Key );
WS_Verandi_3_0.DsLayout diff =
new WS_Verandi_3_0.DsLayout();
diff.Merge( DataPool.m_DsLayout.GetChanges() );
myWS.UpdateLayout( diff, myTH.GenerateToken(
DataPool.m_ThisPersonRow.Email,
DataPool.m_ThisPersonRow.Password ));
//Update locally has already taken
//place, ignore the returned value..
DataPool.m_DsLayout.AcceptChanges();
--
2) The webservice code
[WebMethod ( Description="Fall sem uppfærir DsLayout")]
public DsLayout UpdateLayout( DsLayout p_DsLayout,
string p_sToken )
{
string un = TokenDecrypt( p_sToken );
try
{
sqlAdapLayout.Update( p_DsLayout, C_Layout );
return p_DsLayout;
}
catch( SqlException sq )
{
throw NewException( sq, un );
}
catch( Exception e )
{
throw NewException( e, un );
}
finally
{
CloseConnectionIfOpen();
}
}
//Here is the code which configures the DataAdapter
//
// sqlAdapLayout
//
this.sqlAdapLayout.DeleteCommand = this.scLayoutDelete;
this.sqlAdapLayout.InsertCommand = this.scLayoutInsert;
this.sqlAdapLayout.SelectCommand =
this.scLayoutSelectForPerson;
this.sqlAdapLayout.UpdateCommand = this.scLayoutUpdate;
//And
//
// scLayoutUpdate
//
this.scLayoutUpdate.CommandText = "dbo.[spLayoutUpdate]";
this.scLayoutUpdate.CommandTimeout = 30;
this.scLayoutUpdate.CommandType =
System.Data.CommandType.StoredProcedure;
this.scLayoutUpdate.Connection = this.sqlCon;
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@RETURN_VALUE" ,
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.ReturnValue, false,
((System.Byte)(10)), ((System.Byte)(0)), "",
System.Data.DataRowVersion.Current, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@FK_PersonID_O rg",
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(10)), ((System.Byte)(0)), "FK_PersonID",
System.Data.DataRowVersion.Original, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@FormID_Org",
System.Data.SqlDbType.VarChar, 50,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(0)), ((System.Byte)(0)), "FormID",
System.Data.DataRowVersion.Original, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@FK_PersonID_3 ",
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(10)), ((System.Byte)(0)), "FK_PersonID",
System.Data.DataRowVersion.Current, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@FormID_4",
System.Data.SqlDbType.VarChar, 50, "FormID"));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@LayoutString_ 5",
System.Data.SqlDbType.NVarChar,
1073741823, "LayoutString"));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@Width_6",
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(10)), ((System.Byte)(0)), "Width",
System.Data.DataRowVersion.Current, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@Height_7",
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(10)), ((System.Byte)(0)), "Height",
System.Data.DataRowVersion.Current, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@UD1_8",
System.Data.SqlDbType.VarChar, 50, "UD1"));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@UD2_9",
System.Data.SqlDbType.VarChar, 50, "UD2"));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@UD3_10",
System.Data.SqlDbType.VarChar, 50, "UD3"));
//(Similiar to the other SqlCommands...
--
3) The stored procedure code
CREATE PROCEDURE [spLayoutUpdate]
(@FK_PersonID_Org [int],
@FormID_Org [varchar](50),
@FK_PersonID_3 [int],
@FormID_4 [varchar](50),
@LayoutString_5 [ntext],
@Width_6 [int],
@Height_7 [int],
@UD1_8 [varchar](50),
@UD2_9 [varchar](50),
@UD3_10 [varchar](50))
AS UPDATE [Layout]
SET [FK_PersonID] = @FK_PersonID_3,
[FormID] = @FormID_4,
[LayoutString] = @LayoutString_5,
[Width] = @Width_6,
[Height] = @Height_7,
[UD1] = @UD1_8,
[UD2] = @UD2_9,
[UD3] = @UD3_10
WHERE
( [FK_PersonID] = @FK_PersonID_Org AND
[FormID] = @FormID_Org)
GO
//( The insert sp is similiar )
--
>-----Original Message-----
>Please show us your code that performs the update.
>
>"Ágúst" <agusto@vks.is> wrote in message
>news:027001c36bf3$13705620$a101280a@phx.gbl...
>Hi
>
>I have a windows form app which uses a webservice to
>update data using datasets. On one occasion the dataset
>contains a string value who's length is a little over
>32000 characters.
>
>When that happens the web server throws a error:
>A severe error occured on the current command. The
>result, if any, should be discarded.
>
>Is there a upperbound on how long a string can be sending
>it inside a dataset to a webservice. Behind the scenes
>there is soap etc., is the origin of the error in there or
>what?
>
>Any suggestions warmly welcomed, best regards Ágúst V.Ágúst Guest
-
Marina #3
Re: Error when updating a long text string
Try declaring the parameter as what it actually is - SqlDbyType.NText, not a
long varchar.
"Ágúst" <agustvo@ru.is> wrote in message
news:081901c36c77$8ee44b20$a601280a@phx.gbl...
This is the code.
1) From the windows form
2) From the webservice
3) From the stored procedure
1) Here is the code from the windowsform:
--
WS_Verandi_3_0.WS myWS = new WS_Verandi_3_0.WS();
Verandi_3_0_Common.TokenHandler myTH = new
Verandi_3_0_Common.TokenHandler( CodeConstants.C_Key );
WS_Verandi_3_0.DsLayout diff =
new WS_Verandi_3_0.DsLayout();
diff.Merge( DataPool.m_DsLayout.GetChanges() );
myWS.UpdateLayout( diff, myTH.GenerateToken(
DataPool.m_ThisPersonRow.Email,
DataPool.m_ThisPersonRow.Password ));
//Update locally has already taken
//place, ignore the returned value..
DataPool.m_DsLayout.AcceptChanges();
--
2) The webservice code
[WebMethod ( Description="Fall sem uppfærir DsLayout")]
public DsLayout UpdateLayout( DsLayout p_DsLayout,
string p_sToken )
{
string un = TokenDecrypt( p_sToken );
try
{
sqlAdapLayout.Update( p_DsLayout, C_Layout );
return p_DsLayout;
}
catch( SqlException sq )
{
throw NewException( sq, un );
}
catch( Exception e )
{
throw NewException( e, un );
}
finally
{
CloseConnectionIfOpen();
}
}
//Here is the code which configures the DataAdapter
//
// sqlAdapLayout
//
this.sqlAdapLayout.DeleteCommand = this.scLayoutDelete;
this.sqlAdapLayout.InsertCommand = this.scLayoutInsert;
this.sqlAdapLayout.SelectCommand =
this.scLayoutSelectForPerson;
this.sqlAdapLayout.UpdateCommand = this.scLayoutUpdate;
//And
//
// scLayoutUpdate
//
this.scLayoutUpdate.CommandText = "dbo.[spLayoutUpdate]";
this.scLayoutUpdate.CommandTimeout = 30;
this.scLayoutUpdate.CommandType =
System.Data.CommandType.StoredProcedure;
this.scLayoutUpdate.Connection = this.sqlCon;
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@RETURN_VALUE" ,
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.ReturnValue, false,
((System.Byte)(10)), ((System.Byte)(0)), "",
System.Data.DataRowVersion.Current, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@FK_PersonID_O rg",
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(10)), ((System.Byte)(0)), "FK_PersonID",
System.Data.DataRowVersion.Original, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@FormID_Org",
System.Data.SqlDbType.VarChar, 50,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(0)), ((System.Byte)(0)), "FormID",
System.Data.DataRowVersion.Original, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@FK_PersonID_3 ",
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(10)), ((System.Byte)(0)), "FK_PersonID",
System.Data.DataRowVersion.Current, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@FormID_4",
System.Data.SqlDbType.VarChar, 50, "FormID"));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@LayoutString_ 5",
System.Data.SqlDbType.NVarChar,
1073741823, "LayoutString"));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@Width_6",
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(10)), ((System.Byte)(0)), "Width",
System.Data.DataRowVersion.Current, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@Height_7",
System.Data.SqlDbType.Int, 4,
System.Data.ParameterDirection.Input, false, ((System.Byte)
(10)), ((System.Byte)(0)), "Height",
System.Data.DataRowVersion.Current, null));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@UD1_8",
System.Data.SqlDbType.VarChar, 50, "UD1"));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@UD2_9",
System.Data.SqlDbType.VarChar, 50, "UD2"));
this.scLayoutUpdate.Parameters.Add(new
System.Data.SqlClient.SqlParameter("@UD3_10",
System.Data.SqlDbType.VarChar, 50, "UD3"));
//(Similiar to the other SqlCommands...
--
3) The stored procedure code
CREATE PROCEDURE [spLayoutUpdate]
(@FK_PersonID_Org [int],
@FormID_Org [varchar](50),
@FK_PersonID_3 [int],
@FormID_4 [varchar](50),
@LayoutString_5 [ntext],
@Width_6 [int],
@Height_7 [int],
@UD1_8 [varchar](50),
@UD2_9 [varchar](50),
@UD3_10 [varchar](50))
AS UPDATE [Layout]
SET [FK_PersonID] = @FK_PersonID_3,
[FormID] = @FormID_4,
[LayoutString] = @LayoutString_5,
[Width] = @Width_6,
[Height] = @Height_7,
[UD1] = @UD1_8,
[UD2] = @UD2_9,
[UD3] = @UD3_10
WHERE
( [FK_PersonID] = @FK_PersonID_Org AND
[FormID] = @FormID_Org)
GO
//( The insert sp is similiar )
--
>-----Original Message-----
>Please show us your code that performs the update.
>
>"Ágúst" <agusto@vks.is> wrote in message
>news:027001c36bf3$13705620$a101280a@phx.gbl...
>Hi
>
>I have a windows form app which uses a webservice to
>update data using datasets. On one occasion the dataset
>contains a string value who's length is a little over
>32000 characters.
>
>When that happens the web server throws a error:
>A severe error occured on the current command. The
>result, if any, should be discarded.
>
>Is there a upperbound on how long a string can be sending
>it inside a dataset to a webservice. Behind the scenes
>there is soap etc., is the origin of the error in there or
>what?
>
>Any suggestions warmly welcomed, best regards Ágúst V.
Marina Guest
-
Ágúst #4
Re: Error when updating a long text string
Hi
Thanks for responding Marina.
Actually what has happend is that I updated all my
assemblies to .NET framework 1.1. After that this error
has not returned.
And it is worth mentioning the great performance advance
that .NET framework 1.1 has over 1.0. Soo... if you have
connections... please give thanks to thoose guy's who
updated the framework :-) A great job you guy's!!!
Best regards from Iceland, Ágúst V.
SqlDbyType.NText, not a>-----Original Message-----
>Try declaring the parameter as what it actually is -((System.Byte)>long varchar.
>
>"Ágúst" <agustvo@ru.is> wrote in message
>news:081901c36c77$8ee44b20$a601280a@phx.gbl...
>This is the code.
>1) From the windows form
>2) From the webservice
>3) From the stored procedure
>
>
>1) Here is the code from the windowsform:
>--
>WS_Verandi_3_0.WS myWS = new WS_Verandi_3_0.WS();
>Verandi_3_0_Common.TokenHandler myTH = new
>Verandi_3_0_Common.TokenHandler( CodeConstants.C_Key );
>
>WS_Verandi_3_0.DsLayout diff =
>new WS_Verandi_3_0.DsLayout();
>diff.Merge( DataPool.m_DsLayout.GetChanges() );
>
>myWS.UpdateLayout( diff, myTH.GenerateToken(
> DataPool.m_ThisPersonRow.Email,
> DataPool.m_ThisPersonRow.Password ));
>//Update locally has already taken
>//place, ignore the returned value..
>DataPool.m_DsLayout.AcceptChanges();
>--
>2) The webservice code
>[WebMethod ( Description="Fall sem uppfærir DsLayout")]
>public DsLayout UpdateLayout( DsLayout p_DsLayout,
>string p_sToken )
>{
> string un = TokenDecrypt( p_sToken );
> try
> {
> sqlAdapLayout.Update( p_DsLayout, C_Layout );
> return p_DsLayout;
> }
> catch( SqlException sq )
> {
> throw NewException( sq, un );
> }
> catch( Exception e )
> {
> throw NewException( e, un );
> }
> finally
> {
> CloseConnectionIfOpen();
> }
>}
>//Here is the code which configures the DataAdapter
>//
>// sqlAdapLayout
>//
>this.sqlAdapLayout.DeleteCommand = this.scLayoutDelete;
>this.sqlAdapLayout.InsertCommand = this.scLayoutInsert;
>this.sqlAdapLayout.SelectCommand =
>this.scLayoutSelectForPerson;
>this.sqlAdapLayout.UpdateCommand = this.scLayoutUpdate;
>
>//And
>//
>// scLayoutUpdate
>//
>this.scLayoutUpdate.CommandText = "dbo.[spLayoutUpdate]";
>this.scLayoutUpdate.CommandTimeout = 30;
>this.scLayoutUpdate.CommandType =
>System.Data.CommandType.StoredProcedure;
>this.scLayoutUpdate.Connection = this.sqlCon;
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@RETURN_VALUE ",
>System.Data.SqlDbType.Int, 4,
>System.Data.ParameterDirection.ReturnValue, false,
>((System.Byte)(10)), ((System.Byte)(0)), "",
>System.Data.DataRowVersion.Current, null));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@FK_PersonID_ Org",
>System.Data.SqlDbType.Int, 4,
>System.Data.ParameterDirection.Input, false,((System.Byte)>(10)), ((System.Byte)(0)), "FK_PersonID",
>System.Data.DataRowVersion.Original, null));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@FormID_Org ",
>System.Data.SqlDbType.VarChar, 50,
>System.Data.ParameterDirection.Input, false,((System.Byte)>(0)), ((System.Byte)(0)), "FormID",
>System.Data.DataRowVersion.Original, null));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@FK_PersonID_ 3",
>System.Data.SqlDbType.Int, 4,
>System.Data.ParameterDirection.Input, false,((System.Byte)>(10)), ((System.Byte)(0)), "FK_PersonID",
>System.Data.DataRowVersion.Current, null));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@FormID_4",
>System.Data.SqlDbType.VarChar, 50, "FormID"));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@LayoutString _5",
>System.Data.SqlDbType.NVarChar,
>1073741823, "LayoutString"));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@Width_6",
>System.Data.SqlDbType.Int, 4,
>System.Data.ParameterDirection.Input, false,((System.Byte)>(10)), ((System.Byte)(0)), "Width",
>System.Data.DataRowVersion.Current, null));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@Height_7",
>System.Data.SqlDbType.Int, 4,
>System.Data.ParameterDirection.Input, false,or>(10)), ((System.Byte)(0)), "Height",
>System.Data.DataRowVersion.Current, null));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@UD1_8",
>System.Data.SqlDbType.VarChar, 50, "UD1"));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@UD2_9",
>System.Data.SqlDbType.VarChar, 50, "UD2"));
>this.scLayoutUpdate.Parameters.Add(new
>System.Data.SqlClient.SqlParameter("@UD3_10",
>System.Data.SqlDbType.VarChar, 50, "UD3"));
>//(Similiar to the other SqlCommands...
>--
>3) The stored procedure code
>CREATE PROCEDURE [spLayoutUpdate]
>(@FK_PersonID_Org [int],
>@FormID_Org [varchar](50),
>@FK_PersonID_3 [int],
>@FormID_4 [varchar](50),
>@LayoutString_5 [ntext],
>@Width_6 [int],
>@Height_7 [int],
>@UD1_8 [varchar](50),
>@UD2_9 [varchar](50),
>@UD3_10 [varchar](50))
>
>AS UPDATE [Layout]
>
>SET [FK_PersonID] = @FK_PersonID_3,
>[FormID] = @FormID_4,
>[LayoutString] = @LayoutString_5,
>[Width] = @Width_6,
>[Height] = @Height_7,
>[UD1] = @UD1_8,
>[UD2] = @UD2_9,
>[UD3] = @UD3_10
>
>WHERE
>( [FK_PersonID] = @FK_PersonID_Org AND
>[FormID] = @FormID_Org)
>GO
>//( The insert sp is similiar )
>--
>>>-----Original Message-----
>>Please show us your code that performs the update.
>>
>>"Ágúst" <agusto@vks.is> wrote in message
>>news:027001c36bf3$13705620$a101280a@phx.gbl...
>>Hi
>>
>>I have a windows form app which uses a webservice to
>>update data using datasets. On one occasion the dataset
>>contains a string value who's length is a little over
>>32000 characters.
>>
>>When that happens the web server throws a error:
>>A severe error occured on the current command. The
>>result, if any, should be discarded.
>>
>>Is there a upperbound on how long a string can be sending
>>it inside a dataset to a webservice. Behind the scenes
>>there is soap etc., is the origin of the error in there>>>what?
>>
>>Any suggestions warmly welcomed, best regards Ágúst V.
>
>.
>Ágúst Guest



Reply With Quote

