Inconsistent results with ADO.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a class written in VB.NET which connects to a SQL Server 2000 database, executes a stored procedure and fills an ADO Dataset with the result set. Making the connection to the database and filling the dataset are both done inside of a Try...Catch statment to catch any exceptions.

The program I have makes 2 main calls to this class, both of which return a result set from the database.

When I run this program from my development machine (windows 2000 server) inside the development environment, the clsDatabase successfully fills the ADO datasets with data for both of the main database queries.

When I deploy this program to other machines (both XP professional & windows 2000 server with the .NET framework v1.1 installed), 1 of the main queries returns data, but the other does not. I have code in the program to display a messagebox if the clsDatabase class encounters any exceptions, but none are thrown. I have used messageboxes to see if the code breaks while trying to connect to the database and while filling the dataset, but it does not encounter an error in either place.

Both of my main queries are going to the same SQL Server with the same administrative login, yet only 1 of these 2 queries returns data on the deployment machines, while they both return data on my development machine.

I would be appreciative of any advise anyone can give me.

Thank you
 
I suggest you to place a bunch of Debug.WriteLine methods within your app
and also to use Sql Profiler to see what commands are executed.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

ination said:
I have a class written in VB.NET which connects to a SQL Server 2000
database, executes a stored procedure and fills an ADO Dataset with the
result set. Making the connection to the database and filling the dataset
are both done inside of a Try...Catch statment to catch any exceptions.
The program I have makes 2 main calls to this class, both of which return
a result set from the database.
When I run this program from my development machine (windows 2000 server)
inside the development environment, the clsDatabase successfully fills the
ADO datasets with data for both of the main database queries.
When I deploy this program to other machines (both XP professional &
windows 2000 server with the .NET framework v1.1 installed), 1 of the main
queries returns data, but the other does not. I have code in the program to
display a messagebox if the clsDatabase class encounters any exceptions, but
none are thrown. I have used messageboxes to see if the code breaks while
trying to connect to the database and while filling the dataset, but it does
not encounter an error in either place.
Both of my main queries are going to the same SQL Server with the same
administrative login, yet only 1 of these 2 queries returns data on the
deployment machines, while they both return data on my development machine.
 
Miha,

Thanks for the reply post. I ran SQL Profiler and the queries being performed are correct with the correct parameters.

The strange thing is that this program works in my development environment. When I compile it and distribute it onto another computer, the program executes the correct queries and correct parameters. The difference is that 2 of the 4 queries that run in the distributed version do not return results when all 4 of the queries do return results in the development environment given the exact same parameters.

Do you have any other ideas I could try? I am open to about anything at this point.

Thanks again.

Miha Markic said:
I suggest you to place a bunch of Debug.WriteLine methods within your app
and also to use Sql Profiler to see what commands are executed.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

ination said:
I have a class written in VB.NET which connects to a SQL Server 2000
database, executes a stored procedure and fills an ADO Dataset with the
result set. Making the connection to the database and filling the dataset
are both done inside of a Try...Catch statment to catch any exceptions.
The program I have makes 2 main calls to this class, both of which return
a result set from the database.
When I run this program from my development machine (windows 2000 server)
inside the development environment, the clsDatabase successfully fills the
ADO datasets with data for both of the main database queries.
When I deploy this program to other machines (both XP professional &
windows 2000 server with the .NET framework v1.1 installed), 1 of the main
queries returns data, but the other does not. I have code in the program to
display a messagebox if the clsDatabase class encounters any exceptions, but
none are thrown. I have used messageboxes to see if the code breaks while
trying to connect to the database and while filling the dataset, but it does
not encounter an error in either place.
Both of my main queries are going to the same SQL Server with the same
administrative login, yet only 1 of these 2 queries returns data on the
deployment machines, while they both return data on my development machine.
I would be appreciative of any advise anyone can give me.

Thank you
 
Back
Top