Data access application block

  • Thread starter Thread starter Martin Bischoff
  • Start date Start date
M

Martin Bischoff

Hi,

I'm using the SqlHelper class from microsofts data access application
block and have problems when trying to call a stored procedure that has
a TEXT parameter.

I'm using the following environment:
- SQL Server 2000 SP3a + Cumulative Patch (July 2003)
- .NET 1.0
- Data Access Application Block 1.0

The method SqlHelperParameterCache.DiscoverSpParameterSet returns a
SqlParameter with SqlDbType set to VarChar and Size set to
Int32.MaxValue. The problem seems to be in
SqlCommandBuilder.DeriveParameters.

When calling the stored procedure with the automatically discovered
parameter set, I get an SqlException with one of the following messages:
- General network error. Check your network documentation.
- A severe error occurred on the current command. The results, if any,
should be discarded.

In the servers event log, I can find the following error:

Event Type: Error
Event Source: MSSQL$MYSERVER
Event Category: (2)
Event ID: 17052
Date: 25.07.2003
Time: 16:33:35
User: N/A
Computer: MYSERVER
Description:
Error: 17805, Severity: 20, State: 3
Invalid buffer received from client.
Data:
....


After reading some newsgroup posts, it seems to me that the problem also
occurrs when using binary data. Is there a fix for these problems?


Thanks,
Martin Bischoff
 
Where can I find the Data Access Application Block? A search on MSDN came up
blank?

Wayne

Scot Rose said:
The Application Blocks for .NET are designed to jumpstart development of
..NET distributed applications. The sample code and documentation is provided
"as-is."
While it has undergone testing and is considered a robust code set, there
could be problems that were not found in that testing... Since the code is
available, you could (As you
have done with teh Text problem) work around these problems. There are not
any plans that I am aware of to update these samples in the near future.
Want to know more? Check out the MSDN Library at http://msdn.microsoft.com
or the Microsoft Knowledge Base at http://support.microsoft.com
Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
From: Martin Bischoff <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.adonet
Subject: Data access application block
Date: Fri, 25 Jul 2003 16:58:35 +0200
Lines: 46
Message-ID: <[email protected]>
NNTP-Posting-Host: 194.209.202.80
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 1059145116 19277817 194.209.202.80 (16 [159841])
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
X-Accept-Language: de-ch, de, en-us, en
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!
194.209.202.80!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56716
X-Tomcat-NG: microsoft.public.dotnet.framework.adonet

Hi,

I'm using the SqlHelper class from microsofts data access application
block and have problems when trying to call a stored procedure that has
a TEXT parameter.

I'm using the following environment:
- SQL Server 2000 SP3a + Cumulative Patch (July 2003)
- .NET 1.0
- Data Access Application Block 1.0

The method SqlHelperParameterCache.DiscoverSpParameterSet returns a
SqlParameter with SqlDbType set to VarChar and Size set to
Int32.MaxValue. The problem seems to be in
SqlCommandBuilder.DeriveParameters.

When calling the stored procedure with the automatically discovered
parameter set, I get an SqlException with one of the following messages:
- General network error. Check your network documentation.
- A severe error occurred on the current command. The results, if any,
should be discarded.

In the servers event log, I can find the following error:

Event Type: Error
Event Source: MSSQL$MYSERVER
Event Category: (2)
Event ID: 17052
Date: 25.07.2003
Time: 16:33:35
User: N/A
Computer: MYSERVER
Description:
Error: 17805, Severity: 20, State: 3
Invalid buffer received from client.
Data:
...


After reading some newsgroup posts, it seems to me that the problem also
occurrs when using binary data. Is there a fix for these problems?


Thanks,
Martin Bischoff
 
Never mind - I found it with a Google search -
http://microsoft.com/downloads/deta...0A-9877-4A7B-88EC-0426B48DF275&displaylang=en

Wayne

Wayne Wengert said:
Where can I find the Data Access Application Block? A search on MSDN came up
blank?

Wayne

Scot Rose said:
The Application Blocks for .NET are designed to jumpstart development of
.NET distributed applications. The sample code and documentation is provided
"as-is."
While it has undergone testing and is considered a robust code set,
there
could be problems that were not found in that testing... Since the code is
available, you could (As you
have done with teh Text problem) work around these problems. There are
not
any plans that I am aware of to update these samples in the near future.
Want to know more? Check out the MSDN Library at
http://msdn.microsoft.com
or the Microsoft Knowledge Base at http://support.microsoft.com
Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
From: Martin Bischoff <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.adonet
Subject: Data access application block
Date: Fri, 25 Jul 2003 16:58:35 +0200
Lines: 46
Message-ID: <[email protected]>
NNTP-Posting-Host: 194.209.202.80
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 1059145116 19277817 194.209.202.80 (16 [159841])
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
X-Accept-Language: de-ch, de, en-us, en
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!
 
One more question about the bug in SqlCommandBuilder.DeriveParameters():

Does the problem only occur for parameters of type TEXT, or also for
other types?

Thanks,
Martin Bischoff

I was able to locate some information on this, and yes it is a bug in the SqlCommandBuilder.DeriveParameters() and setting the type after it is retrieved to SqlDbType.Text is the
only currently available workaround (As you found). No current time fram for a fix (Whether it will be in a Service pack or future release of the framework)

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.




--------------------
From: Martin Bischoff <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.adonet
Subject: Re: Data access application block
Date: Tue, 29 Jul 2003 08:40:30 +0200
Lines: 33
Message-ID: <[email protected]>
References: <[email protected]> <[email protected]>
NNTP-Posting-Host: exchange.twi-ag.ch (194.209.202.80)
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 1059460873 21796995 194.209.202.80 (16 [159841])
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
X-Accept-Language: de-ch, de, en-us, en
In-Reply-To: <[email protected]>
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!npeer.de.kpn-eurorings.net!fu-berlin.de!uni-berlin.de!exchange.twi-ag.CH!not-for-
mail

Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56935
X-Tomcat-NG: microsoft.public.dotnet.framework.adonet

Thanks Scot,

what you say is true, and I'm glad microsoft releases application blocks
to help jumpstart development.

But in this case, it seems that it isn't a problem in the application
block, but in the .NET framework class library. I mean, it is
SqlCommandBuilder.DeriveParameters() which returns wrong parameter types
for stored procedures (VarChar instead of TEXT).

Will this method also return wrong parameter types in other cases? And
will it be fixed (for .NET 1.0)?

Best regards,
Martin Bischoff

The Application Blocks for .NET are designed to jumpstart development of .NET distributed applications. The sample code and documentation is provided "as-is."
While it has undergone testing and is considered a robust code set, there could be problems that were not found in that testing... Since the code is available, you could (As you
have done with teh Text problem) work around these problems. There are not any plans that I am aware of to update these samples in the near future.

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.
 
I only saw the mention for text in what I read.

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.




--------------------
From: Martin Bischoff <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.adonet
Subject: Re: Data access application block
Date: Mon, 04 Aug 2003 09:19:25 +0200
Lines: 87
Message-ID: <[email protected]>
References: <[email protected]> <[email protected]> <[email protected]>
NNTP-Posting-Host: exchange.twi-ag.ch (194.209.202.80)
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 1059981566 27075975 194.209.202.80 (16 [159841])
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
X-Accept-Language: de-ch, de, en-us, en
In-Reply-To: <[email protected]>
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!exchange.twi-ag.CH!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:57355
X-Tomcat-NG: microsoft.public.dotnet.framework.adonet

One more question about the bug in SqlCommandBuilder.DeriveParameters():

Does the problem only occur for parameters of type TEXT, or also for
other types?

Thanks,
Martin Bischoff

I was able to locate some information on this, and yes it is a bug in the SqlCommandBuilder.DeriveParameters() and setting the type after it is retrieved to SqlDbType.Text is the
only currently available workaround (As you found). No current time fram for a fix (Whether it will be in a Service pack or future release of the framework)

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.




--------------------
From: Martin Bischoff <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.adonet
Subject: Re: Data access application block
Date: Tue, 29 Jul 2003 08:40:30 +0200
Lines: 33
Message-ID: <[email protected]>
References: <[email protected]> <[email protected]>
NNTP-Posting-Host: exchange.twi-ag.ch (194.209.202.80)
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 1059460873 21796995 194.209.202.80 (16 [159841])
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
X-Accept-Language: de-ch, de, en-us, en
In-Reply-To: <[email protected]>
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!npeer.de.kpn-eurorings.net!fu-berlin.de!uni-berlin.de!exchange.twi-ag.CH!not-for-
mail

Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56935
X-Tomcat-NG: microsoft.public.dotnet.framework.adonet

Thanks Scot,

what you say is true, and I'm glad microsoft releases application blocks
to help jumpstart development.

But in this case, it seems that it isn't a problem in the application
block, but in the .NET framework class library. I mean, it is
SqlCommandBuilder.DeriveParameters() which returns wrong parameter types
for stored procedures (VarChar instead of TEXT).

Will this method also return wrong parameter types in other cases? And
will it be fixed (for .NET 1.0)?

Best regards,
Martin Bischoff


Scot Rose [MSFT] wrote:

The Application Blocks for .NET are designed to jumpstart development of .NET distributed applications. The sample code and documentation is provided "as-is."
While it has undergone testing and is considered a robust code set, there could be problems that were not found in that testing... Since the code is available, you could (As you
have done with teh Text problem) work around these problems. There are not any plans that I am aware of to update these samples in the near future.

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (e-mail address removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.
 
Back
Top