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

Inserting class collection data into Access database

P: n/a
Hi,

I'm working on a C# Winform application and have a number of
collection classes within my application, at present I'm using the
obedb executenonquery method and looping through my class object with
a foreach statement to insert the data into the database which is not
efficient by any stretch. I've been looking for a better solution but
haven't been able to find any, I know datasets are an option as well
but I would prefer a more direct solution.

Thanks in advance for your help.

Mike

Jan 30 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

With Access, that's all you get.

foreach loops

..........

However, you can check this out for .... parameterized queries over sql
strings.

http://www.15seconds.com/issue/020919.htm
There are two main conclusions that can be drawn from these results.
a.. First, if you are executing the same dynamic queries every time in
your script (i.e. without any variables), significant performance gains (in
this case, 36%) can be achieved simply by switching to Stored Queries. With
this comes the aforementioned fringe benefit of increased ease of query
administration. For queries which do contain variables, there are still
performance gains to be had, but they are less significant (8% for the query
tested).

b.. Second (and contrary to my own expectations), using the Command
object's Parameters collection in preference to simply appending the
parameter values to the end of the stored query SQL statement yields only a
minor performance increase. In practice it may be worth completely avoiding
this collection, especially since it is since the extra complication that it
adds to your scripts (i.e. creating parameter objects, defining the data
type, setting the value, and then adding the parameter object to the
collection) may not

You might look at this...
http://www.codeproject.com/dotnet/ELAB.asp
but I've never dealt with it.
Access is NOT a RDBMS.


"obb_taurus" <mi**********@gmail.comwrote in message
news:11*********************@k78g2000cwa.googlegro ups.com...
Hi,

I'm working on a C# Winform application and have a number of
collection classes within my application, at present I'm using the
obedb executenonquery method and looping through my class object with
a foreach statement to insert the data into the database which is not
efficient by any stretch. I've been looking for a better solution but
haven't been able to find any, I know datasets are an option as well
but I would prefer a more direct solution.

Thanks in advance for your help.

Mike

Jan 30 '07 #2

P: n/a
On 30 Jan 2007 12:51:05 -0800, "obb_taurus" <mi**********@gmail.comwrote:
>Hi,

I'm working on a C# Winform application and have a number of
collection classes within my application, at present I'm using the
obedb executenonquery method and looping through my class object with
a foreach statement to insert the data into the database which is not
efficient by any stretch. I've been looking for a better solution but
haven't been able to find any, I know datasets are an option as well
but I would prefer a more direct solution.

Thanks in advance for your help.

Mike
If you don't want to use a dataset, then you are doing it properly.

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Jan 31 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.