?
Solved

Public member 'ExecuteReader' on type 'SqlDataAdapter' not found

Posted on 2006-04-14
2
Medium Priority
?
403 Views
Last Modified: 2008-03-17
I get this error:

Public member 'ExecuteReader' on type 'SqlDataAdapter' not found.

When it tries to run my code below:

        objConn.Open()

        Dim da = New SqlDataAdapter("My_test", objConn)
        da.SelectCommand.CommandType = CommandType.StoredProcedure

        Dim reader As SqlDataReader = da.ExecuteReader() <-------------- error is here

        'Read in the first record and grab the first column
        Dim prowcount As Integer
        If reader.Read() Then
            prowcount = Convert.ToInt16(reader("@@ROWCOUNT"))
        Else
            prowcount = 0
        End If

        MsgBox(prowcount)

        objConn.Close()
0
Comment
Question by:dba123
2 Comments
 
LVL 5

Accepted Solution

by:
razorback041 earned 2000 total points
ID: 16453583
try this...the da uses the .fill method not the reader

Dim cmdSql as new sqlClient.SqlCommand(SP Name here, objConn)
Dim Reader  As SqlDataReader

objConn.Open()
reader = cmdsql.ExecuteReader\

 Dim prowcount As Integer
        If reader.Read() Then
            prowcount = Convert.ToInt16(reader("@@ROWCOUNT"))
        Else
            prowcount = 0
        End If

        MsgBox(prowcount)

        objConn.Close()
0
 
LVL 1

Author Comment

by:dba123
ID: 16453618
thanks much! worked
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question