473,657 Members | 2,667 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Possible Bug in SqlClient.Execu teReader

Hello,

The problem is that when using SqlCommand.Exec uteReader
and the SQL statement raises an error of severity of 16
then ExecuteReader throws an exception, when you use
OdbcCommand.Exe cuteReader the exception is not raised but
when you call Read() method of the OdbcDataReader you then
get the exception which is correct, basically SqlClient
does not let you call the Read method, the main problem is
that if run a Sql statement of say
'Need to create the following SP first.
create proc test
as
rollback tran
go

now run the following SQL through SqlCommand and then
OdbcCommand
begin tran
execute test
select hello="World"

you will notice that SqlCommand throws an exception on
ExecuteReader function where OdbcCommand does not, so Odbc
allows you to call Read and NextResult to go through the
recordset and retrieve your data, wher SqlClient does not
because you don't get the SqlDataReader object back.

Thanks,

Nov 15 '05 #1
0 1383

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1498
by: Mortar | last post by:
i have the following code: SqlConnection con = new SqlConnection("server=myserver;database=myDB;uid=aa;password=aa;"); SqlCommand cmd = new SqlCommand(SQL, con); con.Open(); dgResults.DataSource = cmd.ExecuteReader(); dgResults.DataBind();
3
1419
by: Tony Zoccolillo | last post by:
I have a SQL Server database on a Windows 2000 Server. I have IIS running on a 2nd 2000 Server with no SQL Server on it.. Neither are the PDC. Both servers have the most recent .NET framework installed. When I try to connect from my aspx page using SqlClient I get an error right away. My code looks something like... Imports System.Data.SqlClient Dim Conn2 As New SqlClient.SqlConnection("Data
2
3066
by: TN Bella | last post by:
PLEASE HELP!! I am so far behind....and it doesn't help that I am learning all this stuff. I am using .net framework 1.0 from WebMatrix. These parameters get me all confused...someone please help! Thanks in advance for the assistance. Line 18: MyConn.Open() Line 19: objDR=Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
1
2910
by: HK | last post by:
I just moved an ASP.NET application to a new web server at a different location of ours. The SQL Server machine was moved to that new location at the same time as the web site DNS was pointed to the new server. Suddenly I'm getting lots of intermittent errors of this type. The switch/hub/repeater that routes the traffic at the new location is an older one, if that makes any difference. One thing that bothers me is that the SQL...
2
8896
by: James Cooke | last post by:
Hi all, I want to catch a duplicate key exception. I do not want to provide that verbose message from the MSSQL server - I would put a user friendly message out, like "The item you have added already exists in the database. Please change the description and try to save again." instead of
5
2063
by: Amueerie | last post by:
this may seem a trivial question (as .net may have been solely developed for this purpose), but i'm not certain whether this is possible, i.e. is it possible to access an Oracle DB in .NET (and is it the same as accessing any other db - except for the connection string & object). What is mean is, can i use the same select statements, update statements with the orable database that i used with MSDE & SQL database? thank u all
3
15344
by: Rampa | last post by:
hello! the problem is always the same but i can't understand why it happens!! Someone can help me? FIRST QUERY GOES WELL, SECOND BREAK WITH ERROR why? Dim connessione As New SqlClient.SqlConnection("Server=SOSQLSRV01;Initial Catalog=SO_Bolle;Uid=SO_CattolicaRE;PWD=sogeda") Dim iddestinatario As Integer Dim TestoQueryCodicecodicedestinario As String = "SELECT
2
1884
by: =?Utf-8?B?Y2hpZWtv?= | last post by:
Hello, We recently converted from ASP.net 1.X to ASP.net 2.0 application. Since then, we randomly get the SQL errors when the function tries to get records from SQL. We are using stored procedure and DataAdapter to fill data to Dataset. Does anyone know how to solve this problem? I comfirmed all DataReader in the code is closed after it’s used. Thank you very much for your help.
1
2794
by: thithi | last post by:
Please help me " System.Data.SqlClient.SqlException: Prepared statement '(@Name varchar(100),@Describes varchar(100),@Money char(10))Upda' expects parameter @Describes, which was not supplied. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Assignment.rose.dtgFlower_UpdateCommand(Object source,...
0
8402
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8315
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6172
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.