How to convert a “linq to sql” DataContext to write to flat XML files?

Aside from the why you would want to do this No. There is no method of switching from a SQL Server Database to XML files that is not going to involve a lot of changes to your code As others have pointed out, LINQ to SQL and LINQ to XML are not the same things. LINQ to SQL relies on a context object that knows how to connect to your database, how to read tables, etc.There is no equivalent concept with generalized XML files.

At the very least, you will have to rewrite the data access portion of your project.

Aside from the why you would want to do this... No. There is no method of switching from a SQL Server Database to XML files that is not going to involve a lot of changes to your code. As others have pointed out, LINQ to SQL and LINQ to XML are not the same things.

LINQ to SQL relies on a context object that knows how to connect to your database, how to read tables, etc. There is no equivalent concept with generalized XML files. At the very least, you will have to rewrite the data access portion of your project.

You are barking up the wrong tree. This is the reason for the Repository Pattern; separating the data access layer from the rest of the application logic, so that (for example) the backing store can be changed easily, by switching the repository implementation. Since you have not done that... you are stuck with manually altering your code.

LINQ to SQL is not able to be "converted" to LINQ to XML; it just won't happen.

LINQ to SQL is not able to be "converted" to LINQ to XML; it just won't happen.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions