question

PraveenAmar-6949 avatar image
0 Votes"
PraveenAmar-6949 asked AlbertKallal-4360 edited

asp Sqldatasource with managedOracleDataaccess

Does anyone know if Oracle.ManagedDataAccess.Client provider works with asp:SQLDatasource. I seem to be having issues using that provider for SQLDatasource

dotnet-aspnet-webforms
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AlbertKallal-4360 avatar image
0 Votes"
AlbertKallal-4360 answered AlbertKallal-4360 edited

There are two sides to this coin so to speak.

There is the built in .net tables and data system (often called ado.net).

So, data table, data row, and a few more.

Then you have what is called the provider you use. That provider can be

sqlProvider - this is for sql server ONLY.
oleDB provider. This was and still is realative wide supproted. (often used with ms-access).
ODBC provider. This actaully has become a VERY good choice now. This is especaily the case since you can say connect to ms-access, then change the connection to SQL server, MySQL, Orcle etc. and STILL use the same provider!!!

Vendors provider: MySQL, Oracle, (and more) all quite much have a .net provider for download.

So, if you look at this code, say I using ms-access, and I want to change over to say using the .net provider for oracle.

Remember the two sides of the coin. ONCE you get past the provider, then the REST of the code use the .net data objects is the same.

So, say I had this for ms-access - and useing the oleDB provider for ms-access.
(and it would have been MUCH better had I used and choose ODBC).

So, we have this:

204891-image.png

So, in above, we used the "oleDB" provider. But, everything "after" that provider is going to be .net code, and quite much un-changed.

Now, we dealing with a issue of "semantics" here. Since no doubt, you want the "Oracle sql provider". However, be aware in .net, when you say "sqlprovider", it has a SPECIFIC meaning to the readers here. You can't use the "sql provider" with Oracle. But you can certainly go get a "oracle sql provider".

You can even use nuget to do this.

So, if now say I want to use the oracle provider and NOT ms-access?

Then I ONLY have to change the provider part.

So, nuget, and this:

204867-image.png

So, assuming we have a oracle provider, then the above code now becomes this:

(Imports Oracle.ManagedDataAccess.Client).

So, now ALL the code remains the same, but the "provider" now used is from Oracle.

eg this:

204873-image.png

So, our grids, our data table, row, etc? It is all remains as .net code. The only part you used (or have to change) is the oracle provider.

So, not a "big" deal, but the term "sqlProvider" means SQL server in net land. But yes, you need and want to update or install the Oracle provider, and then as such, you not using the sqlProvider, but in fact are using the Oracle .net provider.

All of the data aware controls, code, wizards, grids etc? Even using DataSet desinger (or now the newer Entitify Frame work tools - they all should continue to work just fine with Oracle).

So, you not looking to use the sqlProvider with Oracle, since that will not work. But, adopting and using the Oracle provider most certainly will and can be used here.

So, the answer is no, you can't and don't use the sqlProvider with Oracle. But that don't mean a lot, since you simply will be using and have to use the oracle provider - not the sqlProvider (it only works with SQL server). So, you free to get/grab/use just about any provider you wish. They all tend to follow the same syntax, and once that provider has pulled data from you (say into a data table), then all .net code from that point on in most cases will work the same when using MS-Access, SQL server, or in this case Oracle. So, yes, you have to use the correct provider, and you can't use the sqlProvider with oracle.

Regards,
Albert D. Kallal (Access MVP 2003-2017)
Edmonton, Alberta Canada




image.png (37.8 KiB)
image.png (6.0 KiB)
image.png (34.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.