R
Rich P
AdventureWorksDataContext dataContext =
new AdventureWorksDataContext();
var query = from contact in dataContext.Contacts
where contact.EmailPromotion==1
select contact;
<
I should probably ask this first:
-->> AdventureWorksDataContext
is this the LinQ To Sql provider? If no -- then where does
AdventureWorksDataContext come from? If yes, do we have to create our
own (for like another data source)? I found an article on msdn
Walkthrough: Creating an IQueryable LINQ Provider
at http://msdn.microsoft.com/en-us/library/bb546158.aspx
This seemed fairly involved. If this is the way it is done for LinQ To
Sql then I am missing the improved value of this over someting like:
SqlConnection conn = new SqlConnection...
SqlDataAdapter da = new SqlDataAdapter...
da.SelectCommand.CommandText = "Select * From Contacts..."
The only thing I could see is that you would have the ability to debug
the Select Statement with the LinQ approach. Am I putting the pieces
together correctly here?
Rich
new AdventureWorksDataContext();
var query = from contact in dataContext.Contacts
where contact.EmailPromotion==1
select contact;
<
I should probably ask this first:
-->> AdventureWorksDataContext
is this the LinQ To Sql provider? If no -- then where does
AdventureWorksDataContext come from? If yes, do we have to create our
own (for like another data source)? I found an article on msdn
Walkthrough: Creating an IQueryable LINQ Provider
at http://msdn.microsoft.com/en-us/library/bb546158.aspx
This seemed fairly involved. If this is the way it is done for LinQ To
Sql then I am missing the improved value of this over someting like:
SqlConnection conn = new SqlConnection...
SqlDataAdapter da = new SqlDataAdapter...
da.SelectCommand.CommandText = "Select * From Contacts..."
The only thing I could see is that you would have the ability to debug
the Select Statement with the LinQ approach. Am I putting the pieces
together correctly here?
Rich