Data Access Components

  • Thread starter Thread starter A.M
  • Start date Start date
A

A.M

Hi,



Is there any tool that automatically generates code for Data Access
component based on existing database table?



Thanks,

Alan
 
Visual Studio .Net can do it but Microsoft says- don't use it!! It's
virtually imposible to accurately generate data access codes through some
tools. I know you would not like this answer but that's the reality.
 
Thanks for Prodip's quick response!

Hi Alan,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to generate data accessing
code automatically according to particular database table. If there is any
misunderstanding, please feel free to let me know.

I think you mean the DataAdapter's SELECT, UPDATE, INSERT and DELETE
commands in this issue. We can use the DataAdapter Configuration Wizard to
accomplish this. You can drag a DataAdapter object from the toolbox and the
wizard will be shown. We just use the query builder to generate the SELECT
command, and the other commands will be generated in later steps of the
wizard.

If you need to generate the commands at runtime using code, and working on
a SQL server as database, we can also use SqlCommandBuilder class to
achieve this. For more information, please check the following link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdatasqlclientsqlcommandbuilderclasstopic.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Prodip said:
Visual Studio .Net can do it but Microsoft says- don't use it!! It's
virtually imposible to accurately generate data access codes through some
tools. I know you would not like this answer but that's the reality.

Erm... perhaps your reality, but not mine or anybody elses. It's
perfectly possible to generate data access code from table definitions,
and even generate SQL on teh fly using simple typed query specifications
and meta-data.

Frans

Frans

--
 
A.M said:
Is there any tool that automatically generates code for Data Access
component based on existing database table?

Depends on which database your tables are in :) We don't support all
databases yet, but a wide range, so perhaps your database is supported.
Feel free to try the demo: http://www.llblgen.com :)

Frans

--
 
SQL Server 2005 allows you to specify Query Hints without actually modifying
the Query itself. This however takes into account the fact that all query
plans are cached. Including Dynamic SQL/Embedded SQL.

Now, for such autogenerated queries, or the ones generated on fly, wouldn't
they be at a terrible disadvantage that you couldn't specify hints to them
in advance?

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/
 
Back
Top