473,796 Members | 2,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.OleDbData Reader
Dim prmTermType As OleDbParameter
Dim cmdTermType As New OleDb.OleDbComm and("sp_web_Sea rch", cnnSearch)
cmdTermType.Com mandType = CommandType.Sto redProcedure

spTermType = cmdTermType.Exe cuteReader()
ddlType1.DataSo urce = spTermType
ddlType1.DataTe xtField = "TerminationTyp e_ID"
ddlType1.DataTe xtField = "TerminationTyp e_ID"
ddlType1.DataBi nd()

spTermType.Clos e() : spTermType = Nothing
spTermType = cmdTermType.Exe cuteReader()
ddlType2.DataSo urce = spTermType
ddlType2.DataTe xtField = "TerminationTyp e_ID"
ddlType2.DataTe xtField = "TerminationTyp e_ID"
ddlType2.DataBi nd()
Nov 18 '05 #1
0 1244

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

Similar topics

3
8130
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
5608
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 can't seem to use this as the first pram OleDbDataReader reader = new OleDbDataReader() i.e public static string Read(OleDbDataReader reader, string query, string
0
1379
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 records. I would like to know does the OleDbDataReader contain the actual information on each record i.e. the fields in the database and their values? Or does the ExecuteReader command only contain the number of records present from the used SQL...
1
272
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 other than using a loop? Thanks in advance, Steven Dim spTermType As OleDb.OleDbDataReader
3
2793
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 reference these pages/ controls from my ASP.NET web projects WEbApp1 url http://localhost/app1 C:\Apps\App1
1
2506
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 invalid cast exception. Is it possible to use the OleDbDataReader to get the value of a currency field in an Access database? If so, how? Rob, who probably shouldn't even ask this question, since the OleDbDataReader is too simplistic. I should...
5
3732
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!! Private Sub TabControl1_TabIndexChanged(ByVal sender As Object, ByVal e
1
1513
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 several User Controls and such for sharing code between screens, but this typically was used things such as menus and headers and footers. What is the best practice in 1.1 for sharing code such as a common set of functions used by multiple screens?
2
1863
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 . my code: Private Sub frmDataEntry_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & Application.StartupPath & "\customer.mdb") ...
4
1654
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 same connection string, and the page class has a connection object too. I'm using the code-behind way of doing things, and I considered leaving the database connection open as a field in the page's class and somehow letting the controls use that...
0
10236
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10182
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,...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7552
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
5445
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...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
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.