PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > Working with Disconnected Data
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Working with Disconnected Data

Réponse
 
LinkBack Outils de la discussion
Vieux 17/07/2008, 17h52   #1
jp2msft
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Working with Disconnected Data

Using VS2005, I can fill a DataSet with multiple DataTables. After this is
done, how would I make a call to that DataSet that can produce distinct
results without having to make a direct SQL call?

I don't even understand that question! So, let me explain further:

In our SQL Server's database, there are many tables, but only a select few
distinct SystemIDs that they are related to.

A stored procedure like this works, but I want to know how to do something
like this using all of the data that has already been collected in my DataSet:

DECLARE @DATE1 CHAR(10)
DECLARE @DATE2 CHAR(10)
SET @DATE1='06/15/2008'
SET @DATE2='07/20/2008'

SELECT A.[System_ID] FROM
(
SELECT DISTINCT [System_ID]
FROM PartsCatalog
WHERE (@DATE1 < Date_Time) AND (Date_Time < @DATE2)
UNION
SELECT DISTINCT [System_ID]
FROM Historic_Records
WHERE (@DATE1 < Date_Time) AND (Date_Time < @DATE2)
UNION
SELECT DISTINCT [System_ID]
FROM Inspections
WHERE (@DATE1 < Date_Time) AND (Date_Time < @DATE2)
UNION
SELECT DISTINCT [System_ID]
FROM Test_Data
WHERE (@DATE1 < Date_Time) AND (Date_Time < @DATE2)
) as A
WHERE ([System_ID] like '%Weld%')


Each of these tables are already in my DataSet, but I do not know how I
would get the new table of information from it like I can using the query
above.

Could someone give me advice on this?

Thank you,
Joe
  Réponse avec citation
Vieux 18/07/2008, 14h40   #2
David Hay
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Working with Disconnected Data

On Jul 17, 11:52 am, jp2msft <jp2m...@discussions.microsoft.com>
wrote:
> Using VS2005, I can fill a DataSet with multiple DataTables. After this is
> done, how would I make a call to that DataSet that can produce distinct
> results without having to make a direct SQL call?
>
> I don't even understand that question! So, let me explain further:
>
> In our SQL Server's database, there are many tables, but only a select few
> distinct SystemIDs that they are related to.
>
> A stored procedure like this works, but I want to know how to do something
> like this using all of the data that has already been collected in my DataSet:
>
> DECLARE @DATE1 CHAR(10)
> DECLARE @DATE2 CHAR(10)
> SET @DATE1='06/15/2008'
> SET @DATE2='07/20/2008'
>
> SELECT A.[System_ID] FROM
> (
> SELECT DISTINCT [System_ID]
> FROM PartsCatalog
> WHERE (@DATE1 < Date_Time) AND (Date_Time < @DATE2)
> UNION
> SELECT DISTINCT [System_ID]
> FROM Historic_Records
> WHERE (@DATE1 < Date_Time) AND (Date_Time < @DATE2)
> UNION
> SELECT DISTINCT [System_ID]
> FROM Inspections
> WHERE (@DATE1 < Date_Time) AND (Date_Time < @DATE2)
> UNION
> SELECT DISTINCT [System_ID]
> FROM Test_Data
> WHERE (@DATE1 < Date_Time) AND (Date_Time < @DATE2)
> ) as A
> WHERE ([System_ID] like '%Weld%')
>
> Each of these tables are already in my DataSet, but I do not know how I
> would get the new table of information from it like I can using the query
> above.
>
> Could someone give me advice on this?
>
> Thank you,
> Joe


Joe,

You might want to move this to the ADO.Net groups. There are more
experts on Datasets there I would imagine.

Good Luck!


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 08h06.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11137 seconds with 10 queries