im pretty much a beginner to using ASP.net and linq to sql but what im trying to do is update a column of a table based on a variable. at the momment i have
Dim db As New sqldcDataContext
Dim update As tableName = (From i in db.tableNames _ Select i)
i think this selects everything, how could i have two variables, one to store what table to update and the other what column. is this possible?
edit: sorry for being unclear
im trying to make this as dynamic as possible so i dont have to type in the exact table/col names. something like this but in the linq to sql syntax.
mysql_query("SELECT * FROM ". $table ." WHERE `" . $column . "` = \"" . $data ."\");
Your question is not entirely clear, and I’m not sure what you are trying to achieve. However, updates are generally done in the following manner with LINQ:
Example assuming you want to update “Customer” table, setting entire column “LastLoginDate” to today. You will also need to have “dragged” this table from “Server Explorer” to your datacontext designer.