views:

515

answers:

3

How i can create a generic datacontext on linq means If database change i don't have to change anything on linq datacontext.

Please specify the code or link

A: 

I don't think this is supported in VS2008. You have to rebuild your .dbml

spender
A: 

If you need this level of dynamic querying, LINQ is probably the wrong technology. One of LINQ's major benefits is static typing - which is usually a plus. Misspell a column in your code and you'll get a compile-time error rather than a run-time error.

But if you need to be able to handle arbitrary changes to the database schema without a recompilation, you'll be fighting the API. Go instead with standard ADO.NET instead (DataReaders, DataAdapters, etc).

Joe Albahari
A: 

I think you want to write a business layer. That's normally how you'd get around having your application be dependent on a particular DAL.

dfowler