Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Set
Message
De
21/07/2004 14:50:50
 
 
À
21/07/2004 14:34:54
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Divers
Thread ID:
00926656
Message ID:
00926710
Vues:
14
It looks like you're creating several calculated fields based on the response to certain questions.

ADO.NET allows you to add a column to a datatable and make that column a calculated column, but I don't know if you can supply one expression when creating a calced column that would do something like what you're describing.

Here are some ideas...if you go to www.syncfusion\faq\winforms, they have several excellent examples of setting up grids that use relational columns.

Or...you could just add the data column 'dealer score' to the data table you already brought in, like this...
MyDataSet.Tables[0].Columns.Add("dealerscore"],typeof(System.Int32));
and then scan through the rows, read Q13_22, and set the dealer score...
for(int nCtr=0;nCtr<MyDataSet.Tables[0].Rows.Count;nCtr++) {
   int nScore = int.Parse(MyDataSet.Tables[0].Rows[nCtr]["Q13_22"].ToString());
   int nDealerScore = 0;
   switch(nScore) {
      case 1:
         nDealerScore = 100;
         break;
      case 2:
         nDealerScore = 80;
         break;
       // and so on
      }
    MyDataSet.Tables[0].Rows[nCtr]["dealerscore"] = nDealerScore   // do your replace
   }

Would that help?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform