Dealing with System.Data.OleDB library wrapper...

  • Thread starter Thread starter SpotNet
  • Start date Start date
S

SpotNet

Hello Newsgroup,

Started a job where an Access 2003 database is accessed with a custom
assembly that wraps\encapsulates the relevant System.Data.OleDb classes
needed for the application. Briefly structured as such;

MS Access 2003 Database <-> Jet40DataAccess (the custom OleDB wrapper
mentioned) <-> Business Logic <-> User Interface.

Jet40DataAccess basically contains (all wrapped up as) & all relevant
members are wrapped in the classes,
OleDbConnection (Jet40Connection)
OleDbCommand (Jet40Command)
OleDbParameterCollection (Jet40ParamterCollection)
OleDbDataReader. (Jet40Reader)

Hence Jet40DataAccess only needs referencing in the business logic part and
does not need to reference System.Data & System.Data.OleDb classes. I want
to include the OleDbParameter class wrapped up as Jet40Parameter, which is
no problem. I can fit it into the assembly pass it to
Jet40ParamterCollection as OleDbParameter fits into
OleDbParameterCollection, but for all obvious reasons I cannot construct a
for each loop to enumerate through parameters that works. Such as;

foreach (Jet40Parameter j40param in j40params) {//j40param stuff.}

for (int i = 0; i < j40params.Count; i++) {j40param = j40params;
//j40param stuff}
works.

Question, what can I do (if it's possible) to get Jet40ParamterCollection to
be an actual collection of Jet40Parameter and Jet40ParamterCollection is a
legitimate parameter collection of Jet40Command? Everything works except the
foreach loop, not essential but I wouldn't mind getting it to work like the
original classes it wraps. Thanks Newsgroup.

Regards,
SpotNet.

Oh yes, MS Access 2003 and VS .NET 2003-C#.
 
You may find the following KB article useful.

http://support.microsoft.com/default.aspx?scid=kb;en-us;322022

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.



Hello Newsgroup,

Started a job where an Access 2003 database is accessed with a custom
assembly that wraps\encapsulates the relevant System.Data.OleDb classes
needed for the application. Briefly structured as such;

MS Access 2003 Database <-> Jet40DataAccess (the custom OleDB wrapper
mentioned) <-> Business Logic <-> User Interface.

Jet40DataAccess basically contains (all wrapped up as) & all relevant
members are wrapped in the classes,
OleDbConnection (Jet40Connection)
OleDbCommand (Jet40Command)
OleDbParameterCollection (Jet40ParamterCollection)
OleDbDataReader. (Jet40Reader)

Hence Jet40DataAccess only needs referencing in the business logic part and
does not need to reference System.Data & System.Data.OleDb classes. I want
to include the OleDbParameter class wrapped up as Jet40Parameter, which is
no problem. I can fit it into the assembly pass it to
Jet40ParamterCollection as OleDbParameter fits into
OleDbParameterCollection, but for all obvious reasons I cannot construct a
for each loop to enumerate through parameters that works. Such as;

foreach (Jet40Parameter j40param in j40params) {//j40param stuff.}

for (int i = 0; i < j40params.Count; i++) {j40param = j40params;
//j40param stuff}
works.

Question, what can I do (if it's possible) to get Jet40ParamterCollection to
be an actual collection of Jet40Parameter and Jet40ParamterCollection is a
legitimate parameter collection of Jet40Command? Everything works except the
foreach loop, not essential but I wouldn't mind getting it to work like the
original classes it wraps. Thanks Newsgroup.

Regards,
SpotNet.

Oh yes, MS Access 2003 and VS .NET 2003-C#.
 
Hello David,

Thank you so much, how well it works. I've been busting (actually did bust)
my head over this. I've been trying all this time to use combinations of
CollectionBase and the interfaces behind OleDbParameterCollection and
OleDbParameter classes, what a tangent to go on. Hey David I did find that
article very useful, thanks alot.

Regards,
SpotNet.


: You may find the following KB article useful.
:
: http://support.microsoft.com/default.aspx?scid=kb;en-us;322022
:
: --
: David Lloyd
: MCSD .NET
: http://LemingtonConsulting.com
:
: This response is supplied "as is" without any representations or
warranties.
:
:
: :
: Hello Newsgroup,
:
: Started a job where an Access 2003 database is accessed with a custom
: assembly that wraps\encapsulates the relevant System.Data.OleDb classes
: needed for the application. Briefly structured as such;
:
: MS Access 2003 Database <-> Jet40DataAccess (the custom OleDB wrapper
: mentioned) <-> Business Logic <-> User Interface.
:
: Jet40DataAccess basically contains (all wrapped up as) & all relevant
: members are wrapped in the classes,
: OleDbConnection (Jet40Connection)
: OleDbCommand (Jet40Command)
: OleDbParameterCollection (Jet40ParamterCollection)
: OleDbDataReader. (Jet40Reader)
:
: Hence Jet40DataAccess only needs referencing in the business logic part
and
: does not need to reference System.Data & System.Data.OleDb classes. I want
: to include the OleDbParameter class wrapped up as Jet40Parameter, which is
: no problem. I can fit it into the assembly pass it to
: Jet40ParamterCollection as OleDbParameter fits into
: OleDbParameterCollection, but for all obvious reasons I cannot construct a
: for each loop to enumerate through parameters that works. Such as;
:
: foreach (Jet40Parameter j40param in j40params) {//j40param stuff.}
:
: for (int i = 0; i < j40params.Count; i++) {j40param = j40params;
: //j40param stuff}
: works.
:
: Question, what can I do (if it's possible) to get Jet40ParamterCollection
to
: be an actual collection of Jet40Parameter and Jet40ParamterCollection is a
: legitimate parameter collection of Jet40Command? Everything works except
the
: foreach loop, not essential but I wouldn't mind getting it to work like
the
: original classes it wraps. Thanks Newsgroup.
:
: Regards,
: SpotNet.
:
: Oh yes, MS Access 2003 and VS .NET 2003-C#.
:
:
:
 
Back
Top