﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Datareader equivalent...</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 17:45:32 GMT</lastBuildDate><ttl>20</ttl><item><title>Datareader equivalent...</title><link>http://forum.strataframe.net/FindPost3415.aspx</link><description>Here is some of my code using a datareader... what is the strataframe equivalent to a datareader?&lt;br&gt;
&lt;br&gt;
[code]&lt;br&gt;
            Using conn As New SqlConnection(ConnectionString)&lt;br&gt;
                Dim cmd As New SqlCommand&lt;br&gt;
&lt;br&gt;
                cmd.CommandText = StoredProcedureName&lt;br&gt;
                cmd.CommandType = CommandType.StoredProcedure&lt;br&gt;
                cmd.Connection = conn&lt;br&gt;
&lt;br&gt;
                cmd.Parameters.AddRange(params)&lt;br&gt;
                conn.Open()&lt;br&gt;
&lt;br&gt;
                Dim reader As SqlDataReader = cmd.ExecuteReader()&lt;br&gt;
&lt;br&gt;
                While reader.Read&lt;br&gt;
                    msLocationName = reader("LocationName")&lt;br&gt;
                    miLocationID = reader("LocationID")&lt;br&gt;
&lt;br&gt;
                End While&lt;br&gt;
&lt;br&gt;
                reader.Close()&lt;br&gt;
                reader = Nothing&lt;br&gt;
                conn.Close()&lt;br&gt;
            End Using&lt;br&gt;
[/code]&lt;br&gt;
&lt;br&gt;
Thanks</description><pubDate>Thu, 12 Oct 2006 15:00:41 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Datareader equivalent...</title><link>http://forum.strataframe.net/FindPost3541.aspx</link><description>Thanks Guys! :D</description><pubDate>Thu, 12 Oct 2006 15:00:41 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Datareader equivalent...</title><link>http://forum.strataframe.net/FindPost3540.aspx</link><description>That method will always block... the callback is used for you to provide a method that should be called if you are using Query Notification Services and the server raises the DataChanged event.&amp;nbsp; If you're not using QNS (which you probably aren't) then just pass in Nothing every time.</description><pubDate>Thu, 12 Oct 2006 14:58:31 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Datareader equivalent...</title><link>http://forum.strataframe.net/FindPost3539.aspx</link><description>Nothing will work fine if you do not want to execute this asynchronously and invoke a callback method when it is completed.&amp;nbsp; By providing the nothing it will just block until the method has completed executing.</description><pubDate>Thu, 12 Oct 2006 14:52:39 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Datareader equivalent...</title><link>http://forum.strataframe.net/FindPost3537.aspx</link><description>Hey Ben,&lt;br&gt;
&lt;br&gt;
Based on the code you provided in your last post I put this piece of code together&lt;br&gt;
&lt;br&gt;
[code] Dim dtbl As DataTable = DataBasics.DataSources("").GetDataTable(cmd, Nothing) [/code]&lt;br&gt;
&lt;br&gt;
Which works and does what i want it to... the only question I have is what am i supposed to provide for the [b] ByVal CallBack As System.Data.SqlClient.OnChangeEventHandler [/b] argument? I put [i] Nothing [/i] and it works I'm just not sure if thats what I'm supposed to put there. :hehe:</description><pubDate>Thu, 12 Oct 2006 14:26:26 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: Datareader equivalent...</title><link>http://forum.strataframe.net/FindPost3440.aspx</link><description>Everything in StrataFrame is disconnected data, but ADO.NET has a DataTableReader that operates in the same fashion as the DbDataReader (by implementing the IDataReader interface).&amp;nbsp; So, if you wanted to create a "reader" you would do this (from within a business object):&lt;/P&gt;&lt;P&gt;Public Function GetReader() As DbDataReader&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Execute the statement and return a new reader&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return New DataTableReader(Me.GetDataTable("SELECT TOP 100 * FROM Customers"))&lt;BR&gt;End Function</description><pubDate>Tue, 10 Oct 2006 09:09:00 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>