Hi - I've been trying to create Datasets and Datatabes with Blinq, but i'm not sure of the syntax or if it's even possible. I want to 'fill' a datable with a blinq static method. Any input on this?
Also, If I understand Blinq, it's already the 'tableadapter' itself? Am I thinking of this in the correct way?
Blinq uses LINQ, which is a separate technology from DataSets. It doesn't create TableAdapters or fill DataTables; instead it returns IQueryable structures which ObjectDataSource can offer up to GridView for binding.
Take a look at the static methods and the syntax they contain. The syntax is LINQ and is a brand new way of querying data in SQL.
Polita Paulus
This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks Polita - I was toying with how to update multiple tables in the same way a as a dataset, or as a way to have in in-memory view of the data (potentially multiple tables). I tried to create a dataset, and then add a table by pointing to one of the
class objects created by Blinq.
The reason is, I was looking for a way to update multiple tables - or, do I need to start a transaction and then do updates?
Here is my situation -- I have a 'customer' table and another table for multiple addresses. i.e., a customer can have 1-to-many addresses. If I was adding a new customer, I would want to hold onto all the generic data in the 'customer' table, as well as
any number of addresses in the 'address' table, and when the user was completely done with all data entry, insert the whole set of data to the DB. This of course would also be true of updates.
Is there an approach you would take to do this with the objects created from with Blinq?
Also, even though it's LINQ, returning IQuery structures, is it not possible to assign/convert one of the structues to a datatable or datview or something like that? That would be neat if Blinq/Linq could be used to fill datasets with data.
Dan, DataSets do not play into the LINQ story at this time. However, you can make all the changes you want to any table and then commit them by calling SubmitChanges().
Polita Paulus
This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks for your patience Polita.....I'm new to quite a bit of this...
Can you clarify for me what you meant? When I'm using the dataset, I add, delete, update rows, and then ultimately call the adapter.Update() method. It seems that SubMitChanges() is the equivalent of Update(), but then what would I use in Blinq to add,
update, delete, or as you put it, make all the changes I want to any table? Also, where do these changes go - is there an equivilent 'in-memory' cache of the data similar to a dataset? If you think I'm missing a major conceptual point, just let me know.
danlv
Member
226 Points
51 Posts
Blinq and DataSets
Sep 06, 2006 04:31 PM|LINK
Hi - I've been trying to create Datasets and Datatabes with Blinq, but i'm not sure of the syntax or if it's even possible. I want to 'fill' a datable with a blinq static method. Any input on this?
Also, If I understand Blinq, it's already the 'tableadapter' itself? Am I thinking of this in the correct way?
Thanks
phuff
Contributor
2700 Points
547 Posts
Microsoft
Re: Blinq and DataSets
Sep 06, 2006 06:02 PM|LINK
Blinq uses LINQ, which is a separate technology from DataSets. It doesn't create TableAdapters or fill DataTables; instead it returns IQueryable structures which ObjectDataSource can offer up to GridView for binding.
Take a look at the static methods and the syntax they contain. The syntax is LINQ and is a brand new way of querying data in SQL.
This posting is provided "AS IS" with no warranties, and confers no rights.
danlv
Member
226 Points
51 Posts
Re: Blinq and DataSets
Sep 06, 2006 06:34 PM|LINK
Thanks Polita - I was toying with how to update multiple tables in the same way a as a dataset, or as a way to have in in-memory view of the data (potentially multiple tables). I tried to create a dataset, and then add a table by pointing to one of the class objects created by Blinq.
The reason is, I was looking for a way to update multiple tables - or, do I need to start a transaction and then do updates?
Here is my situation -- I have a 'customer' table and another table for multiple addresses. i.e., a customer can have 1-to-many addresses. If I was adding a new customer, I would want to hold onto all the generic data in the 'customer' table, as well as any number of addresses in the 'address' table, and when the user was completely done with all data entry, insert the whole set of data to the DB. This of course would also be true of updates.
Is there an approach you would take to do this with the objects created from with Blinq?
Also, even though it's LINQ, returning IQuery structures, is it not possible to assign/convert one of the structues to a datatable or datview or something like that? That would be neat if Blinq/Linq could be used to fill datasets with data.
Dan
phuff
Contributor
2700 Points
547 Posts
Microsoft
Re: Blinq and DataSets
Sep 06, 2006 08:08 PM|LINK
This posting is provided "AS IS" with no warranties, and confers no rights.
danlv
Member
226 Points
51 Posts
Re: Blinq and DataSets
Sep 06, 2006 10:06 PM|LINK
Thanks for your patience Polita.....I'm new to quite a bit of this...
Can you clarify for me what you meant? When I'm using the dataset, I add, delete, update rows, and then ultimately call the adapter.Update() method. It seems that SubMitChanges() is the equivalent of Update(), but then what would I use in Blinq to add, update, delete, or as you put it, make all the changes I want to any table? Also, where do these changes go - is there an equivilent 'in-memory' cache of the data similar to a dataset? If you think I'm missing a major conceptual point, just let me know.
Dan
phuff
Contributor
2700 Points
547 Posts
Microsoft
Re: Blinq and DataSets
Sep 06, 2006 10:11 PM|LINK
Dan, I encourage you to read the LINQ specs on the LINQ page. In particular, this one is a great overview.
This posting is provided "AS IS" with no warranties, and confers no rights.
danlv
Member
226 Points
51 Posts
Re: Blinq and DataSets
Sep 06, 2006 10:29 PM|LINK
Thanks - I will - could you repost that second link? It was broken.
Thanks again.
phuff
Contributor
2700 Points
547 Posts
Microsoft
Re: Blinq and DataSets
Sep 06, 2006 10:36 PM|LINK
This posting is provided "AS IS" with no warranties, and confers no rights.