473,386 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Inserting class collection data into Access database

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
2 1604

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matthew Hood | last post by:
Here's the situation. I am developing an ASP.NET web application. Most of my forms will be accessing a database (MS Access) for either record creation/deletion/updating or for list lookups. The...
3
by: jamie_m_ | last post by:
I have a custom collection ... clFile that INHERITS from NameObjectCollectionBase the problem is, when I try to create an xmlserializer instance i get an error You must implement a default...
11
by: Larry | last post by:
is there a way to add a class property an run-time? If so, how? any code samples? *** Sent via Developersdex http://www.developersdex.com ***
7
by: krs | last post by:
Hi, I'm using the MS timetracker app as a basis for an application I am building. I have at present two classes, Site and SitesCollection, similar to the timeentry and timeentrycollection...
7
by: Buddy Ackerman | last post by:
I created this class Public Class HTMLFileInput : Inherits System.Web.UI.HtmlControls.HtmlInputFile Public Property Data As String Get Return ViewState("HTMLFileInput.Data") End Get Set...
6
by: Mike Wilson | last post by:
Dear Group, I have a heirarchical set of database tables, say - "order" and "order_type" and want to display a series of orders in a grid control, and in place of the order_type foreign key...
1
by: Nemisis | last post by:
hi guys, Currently converting an old classic asp system to a OOP asp.net application. We are building the new application using a 3 tier arcitecture and i was wondering about the following. ...
3
by: shapper | last post by:
Hello, I created a simple class as follows: Public Class HelloWorld Public Function SayMessage() As String Return "Hello World!" End Function
2
by: hakkatil | last post by:
Hi to all, I have a page that inserts excel sheet to access database. I am using asp. What I want to do is to check the inserting record if it is in the database. Basicly checking the dublicate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.