473,404 Members | 2,178 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,404 software developers and data experts.

How to use command reader - multiple database ??

I need to query two tables between two database, I don't know How to do it
in command reader ??
please help.. thanks a lot
Nov 21 '05 #1
5 1816
What DB Are you using? Do you only need to read from it? If so, i'd create
a stored procedure that does this. Or, just create two connections and two
command objects filling two separate datatables (if you need to update the
data - this is probably the way to go) then just use a DataRelation object
to ensure that everything is kosher.
http://www.knowdotnet.com/articles/datarelation.html

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:us*************@TK2MSFTNGP12.phx.gbl...
I need to query two tables between two database, I don't know How to do it
in command reader ??
please help.. thanks a lot

Nov 21 '05 #2
I will use SQL server, after complete "select " query, i need to put the
result in another SQL table,
Should I use store procedure to do it ??

"W.G. Ryan eMVP" <Wi*********@NoSpam.gmail.com> ¦b¶l¥ó
news:eW*************@TK2MSFTNGP09.phx.gbl ¤¤¼¶¼g...
What DB Are you using? Do you only need to read from it? If so, i'd create a stored procedure that does this. Or, just create two connections and two command objects filling two separate datatables (if you need to update the
data - this is probably the way to go) then just use a DataRelation object
to ensure that everything is kosher.
http://www.knowdotnet.com/articles/datarelation.html

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:us*************@TK2MSFTNGP12.phx.gbl...
I need to query two tables between two database, I don't know How to do it in command reader ??
please help.. thanks a lot


Nov 21 '05 #3
I just try store procedure, in vb.net , i need to set the connection string,
for the command text.
BUT I got 2 database (2 connection, how can i set it up) ??
"Agnes" <ag***@dynamictech.com.hk> ¦b¶l¥ó
news:%2****************@TK2MSFTNGP15.phx.gbl ¤¤¼¶¼g...
I will use SQL server, after complete "select " query, i need to put the
result in another SQL table,
Should I use store procedure to do it ??

"W.G. Ryan eMVP" <Wi*********@NoSpam.gmail.com> ¦b¶l¥ó
news:eW*************@TK2MSFTNGP09.phx.gbl ¤¤¼¶¼g...
What DB Are you using? Do you only need to read from it? If so, i'd create
a stored procedure that does this. Or, just create two connections and

two
command objects filling two separate datatables (if you need to update the
data - this is probably the way to go) then just use a DataRelation object to ensure that everything is kosher.
http://www.knowdotnet.com/articles/datarelation.html

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:us*************@TK2MSFTNGP12.phx.gbl...
I need to query two tables between two database, I don't know How to

do it in command reader ??
please help.. thanks a lot



Nov 21 '05 #4
Agnes,

A stored procedure has nothing to do with the method you use, it is the way
how you manage your procedures on the SQL server. When you have a problem
how to do something you can better not start with it, because than you have
everytime to clean them up, but just do it without those. When you are ready
than one of the last things you do is transform your inbuild procedures to
stored procedures.

However you are for me not clear with your problem, what I have seen from
you it cannot be anymore a simple question, so maybe you can explain it a
little bit more?

When it is about copying tables than there are a lot of answers posible and
is it important if the schema of the data you want to load is knowed on the
server where you want to do that.

Cor
Nov 21 '05 #5
Agnes,

Just build two connections and two dataadapters what is the problem with
that?

You maybe even can use one dataset

And I hope you saw what I wrote about the stored procedure.
Cor
Nov 21 '05 #6

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

Similar topics

2
by: Quarantine | last post by:
I am still a noob at the whole .NET, but I have a question and hope someone can help me out. I am taking user input, then want to query a database and return the results to either a datagrid, or a...
5
by: Teo | last post by:
Hi! Sorry for my many postings on this Newsgroup. I am new to ADO.NET and I got Sceppa's book on ADO.NET. It's a great book but covers a lot on the DataAdapter and Offline Data. Now, if I want to...
4
by: Kevin Mansel via .NET 247 | last post by:
Ok, basically this is my problem. I'm building a console app tocall a dos program. So i'm using the Shell command to call theprogram, now depending on what happens, I want to read theoutput that...
6
by: cj | last post by:
I'm tryin to set up a sqlcommand in VB.NET that would issue the command: insert into server1.database.owner.table select * from server2.database.owner.table Since this sqlcommand has it's...
1
by: Chad | last post by:
I am using SQL Server 2000. In Enterprise Mgr, under Management/Current Activity, I see a list SPIDs. I have a multi-tiered .NET web app that uses ADO.NET to connect to the database. Each time a...
10
by: jimmy | last post by:
Hi again, sorry for posting two questions so close together but im working on a school project which is due in soon and running into some difficulties implementing the database parts. I have the...
13
by: Bart | last post by:
Hi, i get the error: "There is already an open DataReader associated with this Command which must be closed first" Thanks Bart ----------------------------------------- Imports...
1
by: vbDavidC | last post by:
Hi, I am fairly new to .net and objects. I learned to create a reader object in method 1, however if I wanted to create multiple select queries in the same module I did not know how to reuse...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.