Data access advice needed

J

John

Hi

I am using strongly typed data access with bound controls in a winform
application. Our requirements are such that they result in a number of sql's
(various sorting/filtering requirements) therefore I am thinking not to use
table adapter with a large number of sqls. Instead I am thinking of using
dynamically created sql with data adapter. Am I correct in my thinking? Is
there a better way to deal with the situation at hand?

Thanks

Regards
 
M

Mr. Arnold

John said:
Hi

I am using strongly typed data access with bound controls in a winform
application. Our requirements are such that they result in a number of
sql's (various sorting/filtering requirements) therefore I am thinking not
to use table adapter with a large number of sqls. Instead I am thinking of
using dynamically created sql with data adapter. Am I correct in my
thinking? Is there a better way to deal with the situation at hand?

The better way is to use Linq-2-SQL or ADO.NET Entity Framework with its
Linq-2-Entities, and using List<T> "bindable to controls" with other
Generic type statements.

You can do sorts, joins, etc and a whole lo of other things with Linq and
let it build the dynamic T-SQL statements for you to query the database.

http://en.wikipedia.org/wiki/Language_Integrated_Query
http://msdn.microsoft.com/en-us/library/bb425822.aspx
http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework

No adapters, no datasets and no dynamic T-SQL built by hand are needed.







__________ Information from ESET NOD32 Antivirus, version of virus signature database 4235 (20090711) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
C

Cor Ligthert[MVP]

John,

Before you think in a technical way, try to think in a more logical way.

What is by instance a sales order it is not a bunch of rows in a dataset or
a datacontext, it is a selected piece of data.

When we are learning we do mostly, Select * from Orders or the equivalent in
Linq to SQL.
Then we are happy because when we make a mistake then we can correct that in
our VB code.

Now start again to define what real a sales order is, it uses data from your
Customer, Header information and detail information.

Try to select that by using the right descriptions.

Again the first thing it is not important how to use it technical (Linq,
DataAdapter, TableAdapter, dynamic, stored procedure).
For every pro argument there is a contra argument.

Cor
 
C

Cor Ligthert[MVP]

John,

As you next time ask these questions then tell that you are using MS Access
like I saw in the AdoNet newsgroup now

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top