Results 1 to 5 of 5

Thread: SQL query on two datbase

  1. #1

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168

    SQL query on two datbase

    Hi all,

    Can we run a SQL query from ADO.net

    For example TABLE1 is in DATABASE1 and TABLE2 is in DATABASE2

    can we run query likey this (as concept, not syntax) :

    select * from table1,table2 from database1,database2 where table1.Field1=table2.Field2


    ==> here Field1 and Field2 are same type of fields in Table1 and Table2 respectively


    I found related information here

    Thanks

  2. #2

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168


    No senior member has read ?

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    use two different queries on the two tables , and fill the datasets with returned values , merge them . Use Find method to look for any value . Try that .

  4. #4

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168
    Thanks Pirate

    I will try it.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    ORR....
    You can
    Code:
    SELECT *
    FROM Table1 T1
    INNER JOIN db2Name..Table2 T2
      ON T1.Field1=T2.Field2
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width