473,608 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datareader

TJS
how is variable dimensioned when assigned to result returned from datareader
function

e.g.
dim dtr AS ???????
dtr = getDataReader()


Nov 18 '05 #1
3 894
If I understand your question right, I think it's System.Object. You mast
cast it or convert it to what it should be or what you want, respectively.

-Darrin
"TJS" <no****@here.co m> wrote in message
news:eD******** ******@TK2MSFTN GP11.phx.gbl...
how is variable dimensioned when assigned to result returned from datareader function

e.g.
dim dtr AS ???????
dtr = getDataReader()

Nov 18 '05 #2
It depends on what type "getDataReader( )" returns. What is
"getDataReader( )"? If it returns a DataReader, then dtr should be declared
as one.

If you are unsure what type getDataReader() returns, set dtr to an object
temporarily and after the dtr assignment line, write:

response.write( dtr.getType.toS tring)

and this will tell you what type came back. Now, you can change the generic
object type to the specific type that came back.

"TJS" <no****@here.co m> wrote in message
news:eD******** ******@TK2MSFTN GP11.phx.gbl...
how is variable dimensioned when assigned to result returned from datareader function

e.g.
dim dtr AS ???????
dtr = getDataReader()

Nov 18 '05 #3
TJS
thanks,
that works

"Darrin J Olson" <da************ @sio.midco.net> wrote in message
news:eC******** ******@TK2MSFTN GP09.phx.gbl...
If I understand your question right, I think it's System.Object. You mast
cast it or convert it to what it should be or what you want, respectively.

-Darrin
"TJS" <no****@here.co m> wrote in message
news:eD******** ******@TK2MSFTN GP11.phx.gbl...
how is variable dimensioned when assigned to result returned from

datareader
function

e.g.
dim dtr AS ???????
dtr = getDataReader()


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
363
by: Yasutaka Ito | last post by:
Hi, My friend had a little confusion about the working of DataReader after reading an article from MSDN. Following is a message from him... <!-- Message starts --> I was going thru DataReader in ADO.NET in MSDN and there is a confusion regarding the buffering of data in case of DATAREADER. The link for MSDN JAN 2004 is -
6
750
by: Ravi | last post by:
Hi, I am not able to understand why a datareader needs a connection to the DB all the time. Here is what I tried. Sqlcommand cmd = ("select * from table1",con) // where con is the connection object 1. DataReader dr = cmd.executereader(); 2.while(dr.read()) { // do something //} I have a break point in line 2. when i run my application and once it hits the break point (i.e line 2) I opened query analyzer and deleted all the rows in...
5
5752
by: Jason Huang | last post by:
Hi, Is it possible to bind DataReader to a DataGrid in C# windows form? And how? And can we update data in a DataSet by using the DataReader? Thanks for help. Jason
12
467
by: Thomas Scheiderich | last post by:
I have 2 dropdowns that are exactly the same and I don't want to re-read for each. Is there a way to do something like below where I read the data, bind to depCity1 and then bind to destCity2. I find that the second one always is blank. I assume this is because the DataReader is read-forward only. ******************************************************** connect.open() cmdSelect = New OleDbCommand("exec populateCities 'North...
20
5523
by: Mark | last post by:
Hi all, quick question , a DataView is memory resident "view" of data in a data table therefore once populated you can close the connection to the database. Garbage collection can then be used to "clean up" the DataView once it is not referenced and will not effect the number of connections to the database. A DataReader on the other hand always maintains a connection to the database and must be explicitly closed (Do not rely on garbage...
2
1571
by: Andrei Pociu | last post by:
In a typical ASP .NET Web Application (website), I'm currently using a class where I declare some public static objects. For example there's the place where I initialize the SqlConnection. Also there's the place where I declare one public static DataReader, but I'm not sure this is the best way to do it. I use that DataReader in all the webforms and user controls, whenever I have to read data from the db. So, should I do it this way or...
1
3087
by: Brent | last post by:
I'm having a hard time wrapping my head around how to build a multi-dimensional array of n length out of a DataReader loop. Take this pseudo-code: ======================================= public string get_array(string sql) { //create db connection & open
7
3390
by: Varangian | last post by:
Hi all, the question I want to ask if the conversion of a DataReader to a Table looping through the DataReader is better than using the Fill Method of the DataAdapter... I'm asking because internally the DataAdapter uses the DataReader... so whats the deal of writing a method that converts a DataReader into a DataTable ? Thanks!
7
2902
by: Diffident | last post by:
Hello All, I would like to use DataReader based accessing in my Data Access Layer (DAL). What is considered to be a best practice while returning from a DAL method that executes a query and returns N rows. DataReader object? Collection object? DataTable object? Returning a DataReader object is not a good practice...right? Thnks for all your suggestions!!
3
3381
by: Johnny Jörgensen | last post by:
I've got an error that I simply cannot locate: I've got a form in which I use a datareader object to read information from a db. After the read, I close the reader and I dispose of both the reader and the command object (but don't close the connection which is public in the solution). The first time i open my form from a parent form, there is no problem. Everything works fine. I then close down my form, and I dispose of the form.
0
8050
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7987
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8472
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8130
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3954
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1318
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.