Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataSet and Calculated Field
Message
De
06/05/2009 18:10:58
 
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01398230
Message ID:
01398235
Vues:
55
This message has been marked as a message which has helped to the initial question of the thread.
>If I want to display Total Price as Qty * Price where Qty comes from one table and Price comes from another, what should I do with my DataSet/TableAdapter?

In my framework data class, I have this condition if we are running against SQL Server:
                ' If we are in SQL Server
                If nBackend = 2 Then

                    ' If we have to make the dataset writable
                    If Not lReadOnly Then
                        loColumn = GetColumn(oDataSet)

                        ' Scan thru all the columns and make them writable
                        For lnCounter = 1 To loColumn.Count
                            lcField = loColumn.Item(lnCounter - 1).ColumnName
                            oDataSet.Tables(0).Columns.Item(lcField).ReadOnly = False
                        Next

                    End If

                End If
Basically, if I define loDataProvider.lReadOnly = True, once the SQL is done, this will make all columns of the dataset table to be writable.

Then, you can scan your dataset results and update any necessary rows.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform