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 > Edit a dataset
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Edit a dataset

Réponse
 
LinkBack Outils de la discussion
Vieux 28/03/2008, 16h54   #1 (permalink)
Sawlmgsj
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Edit a dataset

I want to query a set of tables in order to create a dataset that I can look
at (in a grid in my application) and decide manually whether I want to
include the records for further processing such as including in a report. I
thought to have a bit field which I can treat as a boolean value and then
check or uncheck it in my application. My tables do not contain the bit
field.

Is it possible to generate such a field in my query which can be edited
subseqently by the operator in the grid in the application? I have tried
this with a query, but am not allowed to edit a derived field.

Another thought was to create a temporary table to contain an ID and the bit
field. My original query would populate the temporary table with the ID and
my bit field would be set to 1 (true). After this I create my dataset by
linking my temporary table (via the ID) with my original main table. Then
there is no hindrance to my editing the bit field.

Is there a better way of doing this operation?

Thanks,
Steve.
  Réponse avec citation
Vieux 29/03/2008, 15h46   #2 (permalink)
Dan Guzman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Edit a dataset

> Is it possible to generate such a field in my query which can be edited
> subseqently by the operator in the grid in the application? I have tried
> this with a query, but am not allowed to edit a derived field.


I think you ought to be able to edit the derived value in your DataSet as
long as you don't try save the value to the database.

> Is there a better way of doing this operation?


One method is to add the selection option column to the DataTable after
loading the data. I think this sort of approach is better than returning
the GUI column from the SQL query. For example:

dataSet1.Tables["Table"].Columns.Add("Selected", typeof(bool));


--
Hope this s.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"Sawlmgsj" <Sawlmgsj@discussions.microsoft.com> wrote in message
news:566D47D9-F29D-46F5-80D8-C148A40D6394@microsoft.com...
>I want to query a set of tables in order to create a dataset that I can
>look
> at (in a grid in my application) and decide manually whether I want to
> include the records for further processing such as including in a report.
> I
> thought to have a bit field which I can treat as a boolean value and then
> check or uncheck it in my application. My tables do not contain the bit
> field.
>
> Is it possible to generate such a field in my query which can be edited
> subseqently by the operator in the grid in the application? I have tried
> this with a query, but am not allowed to edit a derived field.
>
> Another thought was to create a temporary table to contain an ID and the
> bit
> field. My original query would populate the temporary table with the ID
> and
> my bit field would be set to 1 (true). After this I create my dataset by
> linking my temporary table (via the ID) with my original main table. Then
> there is no hindrance to my editing the bit field.
>
> Is there a better way of doing this operation?
>
> Thanks,
> Steve.


  Réponse avec citation
Vieux 29/03/2008, 21h28   #3 (permalink)
Sawlmgsj
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Edit a dataset

Dan - many thanks.
I'll give that a try.

Regards,
Steve.


"Dan Guzman" wrote:

> > Is it possible to generate such a field in my query which can be edited
> > subseqently by the operator in the grid in the application? I have tried
> > this with a query, but am not allowed to edit a derived field.

>
> I think you ought to be able to edit the derived value in your DataSet as
> long as you don't try save the value to the database.
>
> > Is there a better way of doing this operation?

>
> One method is to add the selection option column to the DataTable after
> loading the data. I think this sort of approach is better than returning
> the GUI column from the SQL query. For example:
>
> dataSet1.Tables["Table"].Columns.Add("Selected", typeof(bool));
>
>
> --
> Hope this s.
>
> Dan Guzman
> SQL Server MVP
> http://weblogs.sqlteam.com/dang/
>
> "Sawlmgsj" <Sawlmgsj@discussions.microsoft.com> wrote in message
> news:566D47D9-F29D-46F5-80D8-C148A40D6394@microsoft.com...
> >I want to query a set of tables in order to create a dataset that I can
> >look
> > at (in a grid in my application) and decide manually whether I want to
> > include the records for further processing such as including in a report.
> > I
> > thought to have a bit field which I can treat as a boolean value and then
> > check or uncheck it in my application. My tables do not contain the bit
> > field.
> >
> > Is it possible to generate such a field in my query which can be edited
> > subseqently by the operator in the grid in the application? I have tried
> > this with a query, but am not allowed to edit a derived field.
> >
> > Another thought was to create a temporary table to contain an ID and the
> > bit
> > field. My original query would populate the temporary table with the ID
> > and
> > my bit field would be set to 1 (true). After this I create my dataset by
> > linking my temporary table (via the ID) with my original main table. Then
> > there is no hindrance to my editing the bit field.
> >
> > Is there a better way of doing this operation?
> >
> > Thanks,
> > Steve.

>

  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 08h05.


Édité par : vBulletin® version 3.7.2
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
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,42022 seconds with 11 queries