The correct syntax for returning a DataSet
- From: "martinharvey via DotNetMonster.com" <u14945@uwe>
- Date: Mon, 24 Oct 2005 05:08:32 GMT
I realise this is a beginners question but i would be grateful for some help
Untill now i have been using Datareaders for example;
Public Class Catalog
Public Shared Function SP_GetBB() As SqlDataReader
' Create the connection object
Dim connection As New SqlConnection(ConnectionString)
' Create and initialize the command object
Dim command As New SqlCommand("SP_GetBB", connection)
command.CommandType = CommandType.StoredProcedure
' Open the connection
connection.Open()
' Return a SqlDataReader to the calling function
Return command.ExecuteReader(CommandBehavior.CloseConnection)
End Function
Can anyone tell me how to convert the above to return a Dataset
I have got this far but am not sure how to finish:
Public Class Catalog
Public Shared Function SP_GetBB() As System.Data.DataSet
' Create the connection object
Dim connection As New SqlConnection(ConnectionString)
' Create and initialize the command object
Dim command As New SqlCommand("SP_GetBB", connection)
command.CommandType = CommandType.StoredProcedure.........
....................................
many thanks
martin
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/200510/1
.
- Follow-Ups:
- Prev by Date: Re: Component to display formated source code
- Next by Date: RE: Internet Explorer error
- Previous by thread: HTML file server side includes plus forms authentication
- Next by thread: RE: The correct syntax for returning a DataSet
- Index(es):