Hi. I would appreciate some help with how to perform CRUD functions from code behind. I realise that I can simply have a datasource on my page and data bound controls but that isn't appropriate for what I am trying to do. I need to perform the CRUD functions from code behind.
First question is whether I can have a datasource control on the page that isn't bound to any controls and then use that datasource from code behind to perform CRUD actions. If so can anyone provide some code examples.
I realise that I can avoid a datasource control and create a data class (.dbml). If I then create a context object I can reference a table (eg myContext.tableName) and use linq to read data from the db table to a data object. eg
var myDataObj = from x in myContext.tableName select x;
However, at the moment if I want to, say, update data I need to do something like foreach (var dataItem in myDataObj) to step through the data a r
View Complete Post