Question

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

Was it helpful?

Solution

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).

OTHER TIPS

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top