473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

controls sharing one OleDbDataReader

Hello,

I am using the following code which works. My question is does the
OleDbDataReader need to be closed and then re-executed for every control?
Is there a more effecient way of doing this other than using a loop?

Thanks in advance, Steven
Dim spTermType As OleDb.OleDbDataReader
Dim prmTermType As OleDbParameter
Dim cmdTermType As New OleDb.OleDbCommand("sp_web_Search", cnnSearch)
cmdTermType.CommandType = CommandType.StoredProcedure

spTermType = cmdTermType.ExecuteReader()
ddlType1.DataSource = spTermType
ddlType1.DataTextField = "TerminationType_ID"
ddlType1.DataTextField = "TerminationType_ID"
ddlType1.DataBind()

spTermType.Close() : spTermType = Nothing
spTermType = cmdTermType.ExecuteReader()
ddlType2.DataSource = spTermType
ddlType2.DataTextField = "TerminationType_ID"
ddlType2.DataTextField = "TerminationType_ID"
ddlType2.DataBind()
Nov 18 '05 #1
0 1225

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

Similar topics

3
by: Buddy | last post by:
Hello, How do I get the number of row retrieved on a SELECT query when using OleDbDataReader? I am using Framework 1.0.
10
by: Dion Heskett | last post by:
I wish to supply the formating as a parameter, I have tried OleDbDataReader but get a null ref. just can't seem to get this to work. I think this has something to do with ExecuteReader. also...
0
by: Steve1 via DotNetMonster.com | last post by:
Hi all, I''ve created an OleDbDataReader that will contain the number of records that the used SQL query will return. I'm then using a while loop to loop while the OleDBDataReader object has...
1
by: Steven K | last post by:
Hello, I am using the following code which works. My question is does the OleDbDataReader need to be closed and then re-executed for every control? Is there a more effecient way of doing this...
3
by: Shikari Shambu | last post by:
Hi All, I have a situation where multiple applications are sharing some pages/ controls. So, I have a separate common project that has the common pages/ controls. My question is how do I...
1
by: Rob Richardson | last post by:
Greetings! I have a database created in MS Access that has some fields containing Currency data. Every time I try to use one of the OleDbDataReader's GetXXX() methods to read it, I get an...
5
by: scorpion53061 | last post by:
I am trying to be able to share a groupbox and its related controls among all of my tab pages. This does not error but the controls do not appear either. Thank you for your help!! ...
1
by: Joe | last post by:
While I understand that Server Side Includes still work, I realize it's not the best practice for sharing code such as a common set of includes between screens. In ASP.NET I've already built...
2
by: lanmou | last post by:
hi, i am creating a form in my application which dynamically creates controls by getting information from a table in ms access database .now i would like it to get the text by using another table ....
4
by: Mike P2 | last post by:
Hi. I'm writing controls that have to query the database, and it bothers me that I might have several of these controls on a page that each create, open, and close their own connection with the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.