Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Set
Message
From
21/07/2004 14:50:50
 
 
To
21/07/2004 14:34:54
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Miscellaneous
Thread ID:
00926656
Message ID:
00926710
Views:
15
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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform