Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 21st, 2006, 11:06 AM
Registered User
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datareader problem is about to cause my death

when I try to read my datareader, it always returns empty. please help. :)

Here is my code

    Dim SQL As String
    Dim varresult As String

        SQL = "<editied out>" 'the sql string works. returns a record when ran manually.

    Dim objConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrin gs("strConnection").ConnectionString)
    Dim command3 As SqlCommand = New SqlCommand(Sql, objConn)

    Dim dr As SqlDataReader = command3.ExecuteReader()

    If Not (dr Is Nothing) Then
        Do While dr.Read
            varresult = dr("SettingValue").ToString
    End If


Old June 7th, 2006, 07:20 AM
Authorized User
Join Date: Jun 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts

Try using

Dim dr As new SqlDataReader = command3.ExecuteReader()

Using Myself;
Imports Myself

Similar Threads
Thread Thread Starter Forum Replies Last Post
DataReader Problem gaurav_jain2403 ADO.NET 5 October 10th, 2007 03:48 PM
Datareader problem, killing me joer80 ADO.NET 1 March 23rd, 2006 06:44 PM
DataReader problem nalla ASP.NET 1.0 and 1.1 Professional 6 February 7th, 2006 06:07 AM
Forum death? Anyone here to help? CCIX BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 July 5th, 2005 04:33 AM
Problem with datareader ashokparchuri ADO.NET 2 May 13th, 2005 04:32 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.