473,378 Members | 1,395 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,378 software developers and data experts.

Using any Data Provider

Hi,

How do I write a db driven app that will work independently of data
provider. No matter whether backend is Oracle, SQL Server, mySQL or
Access, it should work smoothlesly

tx
Nov 17 '05 #1
8 1456
Sounds like you're a good candidate to use the Data Access Application
Blocks (DAAB) from MS Best Practices.

http://msdn.microsoft.com/library/de.../html/daab.asp

HTH
-Altaf [MVP-VB]

--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com
"Dino Buljubasic" <di**@noplacelikehome.com> wrote in message
news:4f********************************@4ax.com...
Hi,

How do I write a db driven app that will work independently of data
provider. No matter whether backend is Oracle, SQL Server, mySQL or
Access, it should work smoothlesly

tx

Nov 17 '05 #2
You can use something similar to the DBProviderFactory model in .NET 2.0.

Do realize however that when writing code for specific data sources, there
will be lot of code that you will have to write for each database
seperately. In other words, a TSQL stored proc, will never be the same as a
PLSQL stored proc etc.

In short the epitome of the database independent data layer - is impossible.
But you should seperate that junk out in a layer as thin as possible.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
----------------------------------------------------------------------------

"Dino Buljubasic" <di**@noplacelikehome.com> wrote in message
news:4f********************************@4ax.com...
Hi,

How do I write a db driven app that will work independently of data
provider. No matter whether backend is Oracle, SQL Server, mySQL or
Access, it should work smoothlesly

tx

Nov 17 '05 #3
u are wrong. if you design your data access layer clever enough, its
possible..

its nearly possible to implement all T-Sql stored procedures in pl-sql just
with a few tricks and/or syntax. but oracle has ref cursor output parameter
you have to use when you use datareader. if your ExecuteReader methods in
your dataacess layer cleverly adds that parameter to executing commands
parameter collection, it should run in the same manner. all you have to do
rest is rewriting stored procedures in pl-sql. (if you use any)
Nov 17 '05 #4
Dino,

I added an answer in the ADONET newsgroup on your same message about this.
(As more did that today)

Cor
"Dino Buljubasic" <di**@noplacelikehome.com> schreef in bericht
news:4f********************************@4ax.com...
Hi,

How do I write a db driven app that will work independently of data
provider. No matter whether backend is Oracle, SQL Server, mySQL or
Access, it should work smoothlesly

tx

Nov 17 '05 #5
I'm using an Interface to do this, by creating components for each database
type and instantiating the required type at runtime.

Check out the excellent example by WillemM:-
http://www.codeproject.com/cs/databa...ata_Access.asp

Rgds,
Dave

"Dino Buljubasic" <di**@noplacelikehome.com> wrote in message
news:4f********************************@4ax.com...
Hi,

How do I write a db driven app that will work independently of data
provider. No matter whether backend is Oracle, SQL Server, mySQL or
Access, it should work smoothlesly

tx

Nov 17 '05 #6
The Crow,

All TSQL procedures can be implemented in PLSQL - afterall equivalent logic
concepts do exist on either side.

However, since the two databases are inherently different, the function
names are different, concurrency mechanisms are different, and a number of
other differences, it will rarely be as simple as the example you pick.
Trust me, it is not as simple as "cleverly adding a parameter".

For selects it may even work, the real problem occurs when you try saving
data back into the database.
--

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
----------------------------------------------------------------------------

"The Crow" <q> wrote in message
news:OQ**************@TK2MSFTNGP14.phx.gbl...
u are wrong. if you design your data access layer clever enough, its
possible..

its nearly possible to implement all T-Sql stored procedures in pl-sql
just with a few tricks and/or syntax. but oracle has ref cursor output
parameter you have to use when you use datareader. if your ExecuteReader
methods in your dataacess layer cleverly adds that parameter to executing
commands parameter collection, it should run in the same manner. all you
have to do rest is rewriting stored procedures in pl-sql. (if you use any)

Nov 17 '05 #7
I beleive your answer was to use OleDb or ODBC.

Yes that may work, but you get a much restricted feature set, and a much
lower performance.
--

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
----------------------------------------------------------------------------
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uE**************@TK2MSFTNGP10.phx.gbl...
Dino,

I added an answer in the ADONET newsgroup on your same message about this.
(As more did that today)

Cor
"Dino Buljubasic" <di**@noplacelikehome.com> schreef in bericht
news:4f********************************@4ax.com...
Hi,

How do I write a db driven app that will work independently of data
provider. No matter whether backend is Oracle, SQL Server, mySQL or
Access, it should work smoothlesly

tx


Nov 17 '05 #8
OleDb,

Yes that may work, but you get a much restricted feature set, and a much
lower performance.

As I wrote.

Cor

Nov 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
2
by: Roland Hall | last post by:
I have two(2) issues. I'm experiencing a little difficulty and having to resort to a work around. I already found one bug, although stated the bug was only in ODBC, which I'm not using. It...
2
by: Joe | last post by:
Hi All, I am new to using the Access DB and I need some help if someone is able to give it to me. What I want to do is get the names of the columns of certain tables. Not the data in the table...
4
by: Oceania | last post by:
Hi All, I did try using the sample code from the ADO.net forum to link one table, it is working fine. But, I got a problem when I tried to link all tables (20 tables)... Please help, thank...
2
by: Randy | last post by:
I am trying to relink some Oracle tables in an Access database via VB.NET and ADOX. I receive the following error when executing the cat.ActiveConnection link "Arguments are of the wrong type,...
3
by: Michael Hoehne | last post by:
Hi, I'm currently facing a problem with a mixed environment using .NET 1.1 and ..NET 2.0 web services. We have a client application (the "client", system 1) running on .NET 2.0/WinXP, calling...
0
by: acwomble | last post by:
I am working with a database on another system via a ssh tunnel using plink. We have setup an alias the local system for the remote database. I am able to connect and work from within Visual...
5
by: msch-prv | last post by:
Hi, I am trying to tie a SQLDataSource control to MySQL without success. The connection string works ok with an ObjectDataSource. (Native asp.net 2.0 MySQL dll loaded in /bin) For some reason,...
0
by: pal | last post by:
MIME-Version: 1.0 Content-Type: multipart/related; boundary="ERCOT-XML-DATA"; Type="application/X-ERCOT-MARKETS" --ERCOT-XML-DATA Content-Type: application/xml <?xml version="1.0"...
1
by: Carmine [www.thetotalsite.it] | last post by:
Hi, I am using ASP.Net 2.0 with the MySQL Connector .Net 5.1.2.2. I added these lines to the web.config to make the connector.net able to handle the SqlConnection object (and so to bind it to a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.