Is there a built in way to create a table if it does not exist from the DataContext Table class? Or is the only way to use raw sql statements?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are talking about using the built in linq-to-sql datacontext class then you can always refresh it from the database if you create a new table and it should be picked up.
How about defining the table manually like this:
then you can access the table like this:
Then you can query it or add rows or whatever. Hope that helps.