Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
SqlDataReader showing Empty columns until after error.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="lithoman, post: 1984517"] Let's take the first column for instance. It is supposed to contain the value 8. When I run the Procedure in SQL Manager, I get exactly that. When I debug the app and step through the code, I watch the contents of reader._data[0]. Right after reader.Read(), here are a sample of relevant values: _isNull : false _type: Empty IsEmpty: true IsNull: false Int32: 'reader._data[0].Int32' threw an exception of type System.InvalidCastException' Value: {} Now as far as I know (I am quite new to .Net, however) Read() makes the next record available, and that record's content is in reader until Read() is invoked again or the reader is destroyed. But after the error is thrown that same object reads: _isNull : false _type: Int32 IsEmpty: false IsNull: false Int32: 18 Value: 18 The same is happening with all columns of that first record. Any idea why the change in content? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
SqlDataReader showing Empty columns until after error.
Top