DataReader Vacio

02/08/2004 - 23:59 por HH | Informe spam
Hola a todos.
Como hago para saber cuando un DataReader no tiene
registros ?
 

Leer las respuestas

#1 Angel. E. Ruiz. Pastor
03/08/2004 - 02:54 | Informe spam
Dim connString As String = "Data Source=myserver; Initial Catalog=tots; User
ID=sa; Password="
Dim i As Int32
Dim conn As New System.Data.SqlClient.SqlConnection(connString)
conn.Open()
Dim cmd As New System.Data.SqlClient.SqlCommand("select * from tblLeads",
conn)
Dim reader As SqlDataReader
Try
reader = cmd.ExecuteReader()
Catch e As Exception
Debug.WriteLine(e)
Debug.WriteLine(sql)
Return New System.Collections.ArrayList
End Try
Do While reader.Read()
' tiene registros
Loop
conn.Close()


Saludos cordiales,
Ángel Ruiz
[MS Visual Basic Developer MVP]
Caracas - Venezuela

"El conocimiento es un bien, que crece a medida que se comparte"

"HH" wrote in message
news:9b6a01c478db$f800a7e0$
Hola a todos.
Como hago para saber cuando un DataReader no tiene
registros ?

Preguntas similares