Last post Sep 06, 2006 06:36 PM by phuff
Sep 06, 2006 12:31 PM|danlv|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?
Sep 06, 2006 02:02 PM|phuff|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.
Sep 06, 2006 02:34 PM|danlv|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.
Sep 06, 2006 04:08 PM|phuff|LINK
Sep 06, 2006 06:06 PM|danlv|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.
Sep 06, 2006 06:11 PM|phuff|LINK
Dan, I encourage you to read the LINQ specs on the
LINQ page. In particular,
this one is a great overview.
Sep 06, 2006 06:29 PM|danlv|LINK
Thanks - I will - could you repost that second link? It was broken.
Sep 06, 2006 06:36 PM|phuff|LINK