Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / March 2008

Tip: Looking for answers? Try searching our database.

Edit a dataset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sawlmgsj - 28 Mar 2008 16:54 GMT
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.
Dan Guzman - 29 Mar 2008 15:46 GMT
> 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));

Signature

Hope this helps.

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

>I want to query a set of tables in order to create a dataset that I can
>look
[quoted text clipped - 21 lines]
> Thanks,
> Steve.
Sawlmgsj - 29 Mar 2008 21:28 GMT
Dan - many thanks.
I'll give that a try.

Regards,
Steve.

> > 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
[quoted text clipped - 36 lines]
> > Thanks,
> > Steve.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.