Reputation: 607
I've read about ways to synch my SQL database with my C# code, and it looks like the DataContext object is the way I'm going to go.
After having read up on what it can do, I find myself still slightly confused on its exact capabilities. For instance, once set up, does the DataContext linked to my SQL database contain a property for each table? And does that table object then contain a list of items, each of which holds the data for each table entry?
In addition, I'm not sure how to instruct it to generate me the code (since I've read that it does generate the necessary objects). How is this achieved?
Upvotes: 0
Views: 4744
Reputation: 14460
"does the DataContext linked to my SQL database contain a property for each table"
YES you will be able to accesss all the table and properties,
that you have used in your datacontext (.dbml) file
Anyway, please read this article about LINQ TO SQL. Also there are some good video tutorial about ASP.NET 3.5 LINQ TO SQL
Hope this help
Upvotes: 1
Reputation: 69260
What have you tried so far?
There are two ways to generate the code:
Upvotes: 0
Reputation: 33139
The Gu (Scott Guthrie) has an excellent article series about Linq to Sql that introduces this concept: http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx
Good luck!
Upvotes: 3