R
Rich P
I have already heard that LinQ to Sql will be replaced by LinQ to
Entities or something like that. My question is below: that the whole
concept of LinQ whatever -- it is supposed to be better than or provide
some enhancement to the DataAdapter / Sql (tSql) model. I am sure that
there is some benefit provided by LinQ (or the idea behind it) - or
people would not be using it. What is the benefit of LinQ (or the idea
behind it) ?
Here is a linQ query and below that a DataAdapter query
-------------------------
DataClasses1DataContext dc = new DataClasses1DataContext();
var q =
from a in dc.GetTable<Order>()
where a.CustomerID.StartsWith("A")
select a;
dataGridView1.DataSource = q;
----------------------------
string Sql = "Select * From Order
Where CustomerID Like 'A%';
DataAdapter1.SelectCommand.CommandTest = Sql;
DataAdapter1.Fill(ds, "tbl1");
datagridview1.Datasource = ds.Tables["tbl1"];
Is LinQ (or the idea behind it) just less typing - or is the benefit
seen more in web applications? Or does LinQ (or the idea behind it) do
or supposed to do something that can't be done with DataAdapters - like
say - query data inside of a dataset in an application? Once I
understand what the idea of LinQ is supposed to do -- it will all make
sense to me.
Thanks
Rich
Entities or something like that. My question is below: that the whole
concept of LinQ whatever -- it is supposed to be better than or provide
some enhancement to the DataAdapter / Sql (tSql) model. I am sure that
there is some benefit provided by LinQ (or the idea behind it) - or
people would not be using it. What is the benefit of LinQ (or the idea
behind it) ?
Here is a linQ query and below that a DataAdapter query
-------------------------
DataClasses1DataContext dc = new DataClasses1DataContext();
var q =
from a in dc.GetTable<Order>()
where a.CustomerID.StartsWith("A")
select a;
dataGridView1.DataSource = q;
----------------------------
string Sql = "Select * From Order
Where CustomerID Like 'A%';
DataAdapter1.SelectCommand.CommandTest = Sql;
DataAdapter1.Fill(ds, "tbl1");
datagridview1.Datasource = ds.Tables["tbl1"];
Is LinQ (or the idea behind it) just less typing - or is the benefit
seen more in web applications? Or does LinQ (or the idea behind it) do
or supposed to do something that can't be done with DataAdapters - like
say - query data inside of a dataset in an application? Once I
understand what the idea of LinQ is supposed to do -- it will all make
sense to me.
Thanks
Rich