RE: Data Access



Someone has already written some code to use reflection and custom attributes
to dynamically build the required SQL.

http://www.codeproject.com/cs/database/dal1.asp
http://www.codeproject.com/dotnet/persistence_by_reflection.asp


"rufus" wrote:

> Up until now I have been using OR Mapping tools for my database access. I
> liked this approach because with one line of code I could bind my form fields
> to my objects and then persist them. The SQL code for update and insert was
> generated instrinsically.
>
> Now I need to use more 'mainstream' methods of data manipulation but am
> becoming a little frustrated. If i wish to insert some data submitted by a
> form, I need to append the contents of each form field as a parameter to
> execute the stored procedure. Not to mention having to write the insert SQL
> for the stored procedure. I find this tedious and the code can be quite long
> when there are say 30 form fields that need to be inserted or updated.
>
> My question is, is there are way to perform insert, update or deletes
> without have to write any (or at least limited) sql? Or are there any
> methods that reduce the amount of code to retrieve form field contents and do
> an update? Ideally I would like to use reflection to map beween my form
> fields and the correct column in the table. Is this possible? Am I missing
> something obvious?
.



Relevant Pages

  • Re: SQL Injection Code Help
    ... Sorry but I am a newbie. ... "Dan Guzman" wrote: ... We have locked down the SQL ... form fields to only allow the following characters so no SQL instructions ...
    (microsoft.public.sqlserver.security)
  • Re: Speed Effeciency on Form updates
    ... Once you hit a wall with SQL, you can start thinking about a VBA solution. ... If that gets too inefficient also, you will need to consider using a temporary table to store the partially massaged data for further processing. ... Tips for Access users - http://allenbrowne.com/tips.html ... results into the form fields or is it better to use controlsource property ...
    (microsoft.public.access.modulesdaovba)
  • SQL Database results follow up
    ... I have the simplest of queries against a SQL table: ... f_docnumber to search for in the database. ... One or more form fields were empty. ... the query works perfectly. ...
    (microsoft.public.frontpage.client)
  • Data Access
    ... Now I need to use more 'mainstream' methods of data manipulation but am ... execute the stored procedure. ... Not to mention having to write the insert SQL ... when there are say 30 form fields that need to be inserted or updated. ...
    (microsoft.public.dotnet.general)
  • Re: SQL Injection Code Help
    ... I'm so tired of seeing people working as programmers that know absolutely ... We have locked down the SQL ... form fields to only allow the following characters so no SQL ... If an apostrophe is entered we want it to be converted to two ...
    (microsoft.public.sqlserver.security)