I have a data table that contains some values for Certifications. This table can be updated in a different part of my application. On the web page I am currently working on, I would like to have check boxes appear for every value in the data table. I
have been struggling with this trying to use a For Each loop and I cannot get it to work for anything. Any suggestions?
I am using the following Razor syntax to obtain my data (I know this works because I can display it in a WebGrid):
@{
var
db = Database.Open("MyConn");
var
sql = "SELECT CertDesc FROM Certification ORDER BY CertDesc";
LSNelson
Member
1 Points
4 Posts
Checkboxes from data table
Aug 18, 2010 09:14 PM|LINK
I have a data table that contains some values for Certifications. This table can be updated in a different part of my application. On the web page I am currently working on, I would like to have check boxes appear for every value in the data table. I have been struggling with this trying to use a For Each loop and I cannot get it to work for anything. Any suggestions?
I am using the following Razor syntax to obtain my data (I know this works because I can display it in a WebGrid):
@{
var db = Database.Open("MyConn");
var sql = "SELECT CertDesc FROM Certification ORDER BY CertDesc";
var data = db.Query(sql);
}