Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 July 1st, 2003, 10:02 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to "Set" a function equal to a DataReader

I'm trying to do this...

'<--------------------Start Code---------------------->'
Function GetReader() as SqlDataReader
    Dim strConn as String = ConfigurationSettings.AppSettings("strConn")
    Dim conn As New SqlConnection (strCONN)
    Dim strSQL = "Select * from Table1"
    Dim oCmd as New SqlCommand (strSQL)
    oCmd.Connection = conn
    conn.Open

    Dim oRead As SqlDataReader = oCmd.ExecuteReader ()

    Set GetReader = oRead 'This line doesn't work

    conn.Close

End Function
'<---------------------End Code----------------------->'

What I want to do is set up a function that executes a stored procedure and returns the reader. When I try to run this I get a message saying "Set" isn't supported anymore. I'm cool with that. Now I'm just wondering how to duplicate that functionality, or something similar, in .Net.

Thanks,

Jerry
 
Old July 1st, 2003, 10:15 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Return oRead





Similar Threads
Thread Thread Starter Forum Replies Last Post
function node-set bound to undefined prefix exslt khwab XSLT 3 August 8th, 2007 12:31 PM
set password equal to variable fizzerchris SQL Server 2005 3 April 30th, 2007 01:45 AM
node-set function Bernardo Pacheco XSLT 2 June 19th, 2006 10:45 AM
Set form value equal to databse fs22 Javascript How-To 17 July 16th, 2004 04:39 AM
rescord set into javascript function dave wx Classic ASP Professional 1 December 10th, 2003 10:26 AM





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