Stored Procedure

35 pts.
Tags:
ADO.NET
SQL stored procedures
I am calling some stored Procedure, having selct statment, after inserting some a new data entry by different stored procedure. Some times my Select stored procedure does not return any value. Data is exactly correct and when I explicitly called that SP with same data by Query analyzer, I will got the desired result. The error I have got is System.Data error in vb.Net, due to empty DataReader. Strange is that dataReader is return true when I am calling dr.read(). Not getting exact solution.

Answer Wiki

Thanks. We'll let you know when a new response is added.

I would assume that you aren’t passing the parameters to the procedure correctly. Run SQL Profiler against the SQL Server. This will tell you what the exact command being run against the SQL Server is. If when you run that you get the correct data back then the SQL Part is working correctly, and you can focus on the .NET code not working correctly.

What’s the exact error that you are getting?

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Deepanshu
    I have got the solution, I have used architecture such that, I have got the datareader object, which I have assigned in my loca dataReader having scope in a method. From this method I have passed my datareader with reference to a different method, where I perform the read operation. Many times this .Net code work properly, But some times it won't work because .Net GC already remove my datreader object, when I am passing datareader to different method. I have change variable scope to a class level and now it will work properly. The important thing is that I am using autoclose functionality of dataReader.
    35 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following