By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,901 Members | 1,496 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,901 IT Pros & Developers. It's quick & easy.

Data Access

P: n/a
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?
Nov 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
This won't take care of binding to your form but you may
find the code generator does enough of the rest to make it
a viable solution for SQL Server or Microsoft Access.

Plus, it is OOP...

http://www.eggheadcafe.com/articles/..._generator.asp

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net

"rufus" <ru***@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
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?

Nov 22 '05 #2

P: n/a
Rufus,

It has it limitations (max 100 datafields, the same as with the designer no
joined tables etc etc). For the rest is works mostly fine (when you have
some more extended problems you would have to do it yourself). However from
what I read in your message will it probably fit on at least 80%.

http://msdn.microsoft.com/library/de...classtopic.asp

It is there as well as SQL, Oracle, ODBCcommandbuilder.

I hope this helps,

Cor
Nov 22 '05 #3

P: n/a
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/pe...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?

Nov 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.