PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
How to: Query/Subquery against 2 datasets within application?
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
How to: Query/Subquery against 2 datasets within application?
![]() |
How to: Query/Subquery against 2 datasets within application? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I'm writing a .NET 2.0 windows forms application to do Phone maintenance. I
have 2 databases that exist on separate database servers, Employees and Phones. They both use a common key, EmployeeNumber. I have been using a subquery approach to populate a combo box with the Employees not in the Phones database to help with inputting new employees. I utilize a linked server to make it work and that works fine. I also populate a couple of datasets in my application, Employees and Phones using 2 different connection strings. I was thinking since I already have this data in my application it seems foolish to have to maintain a linked server and make a separate trip to the server to get this data. I'd like to figure out how to do my query/subquery inside my application instead of making a trip to the database. Is there a way to do this? Thanks, John |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Here's the query/subquery -- I meant to include it:
select EmplNo = CAST(RIGHT(RTRIM(Empl_No),4) as int), LastName,FirstName,FullName,Dept_no,Sub_Dept,HireDate from sqlServer6.county.dbo.empl where CAST(RIGHT(RTRIM(Empl_No),4) as int) not in (select intEmployeeNumber from PHONE where intEmployeeNumber is not null) order by HireDate desc John "Tuna Fly" wrote: > I'm writing a .NET 2.0 windows forms application to do Phone maintenance. I > have 2 databases that exist on separate database servers, Employees and > Phones. They both use a common key, EmployeeNumber. I have been using a > subquery approach to populate a combo box with the Employees not in the > Phones database to help with inputting new employees. I utilize a linked > server to make it work and that works fine. I also populate a couple of > datasets in my application, Employees and Phones using 2 different connection > strings. > > I was thinking since I already have this data in my application it seems > foolish to have to maintain a linked server and make a separate trip to the > server to get this data. I'd like to figure out how to do my query/subquery > inside my application instead of making a trip to the database. Is there a > way to do this? > > Thanks, > > John |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Tuna Fly
The QuerADatatset assumembly I've developed let's you issue queries and sub-queries against a single Dataset. It lets you perform complex SQL SELECT statements including UNION, JOINS, GROUP BY, HAVING, ORDER BY, sub-queries, functions, etc against the tables in a dataset. Adrian Moore http://www.queryadataset.com "Tuna Fly" <tunafly@mahi.com> wrote in message news:E8CCC331-D005-4CF1-984E-15AA996C1681@microsoft.com... > I'm writing a .NET 2.0 windows forms application to do Phone maintenance. > I > have 2 databases that exist on separate database servers, Employees and > Phones. They both use a common key, EmployeeNumber. I have been using a > subquery approach to populate a combo box with the Employees not in the > Phones database to help with inputting new employees. I utilize a linked > server to make it work and that works fine. I also populate a couple of > datasets in my application, Employees and Phones using 2 different > connection > strings. > > I was thinking since I already have this data in my application it seems > foolish to have to maintain a linked server and make a separate trip to > the > server to get this data. I'd like to figure out how to do my > query/subquery > inside my application instead of making a trip to the database. Is there a > way to do this? > > Thanks, > > John |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

