A
Asier
Hello,
I've a webService thar read from my database and let results in a
SqlDataReader. I want to return this datreader to my ASP.NET page but it
fail.
This is my code:
***************************
Dim cnConexion As New SqlConnection("..................")
<WebMethod()> Public Function fLeerTodasCIAs() As SqlDataReader
Dim drCIAS As SqlDataReader
Dim cmd As New SqlCommand("spCIASLeerTodas", cnConexion)
cmd.CommandType = CommandType.StoredProcedure
cnConexion.Open()
drCIAS = cmd.ExecuteReader(CommandBehavior.CloseConnection)
drCIAS.Close()
End Function
**************************
What is the problem?? thanks
Asier
I've a webService thar read from my database and let results in a
SqlDataReader. I want to return this datreader to my ASP.NET page but it
fail.
This is my code:
***************************
Dim cnConexion As New SqlConnection("..................")
<WebMethod()> Public Function fLeerTodasCIAs() As SqlDataReader
Dim drCIAS As SqlDataReader
Dim cmd As New SqlCommand("spCIASLeerTodas", cnConexion)
cmd.CommandType = CommandType.StoredProcedure
cnConexion.Open()
drCIAS = cmd.ExecuteReader(CommandBehavior.CloseConnection)
drCIAS.Close()
End Function
**************************
What is the problem?? thanks
Asier