Wrox Programmer Forums
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 1st, 2012, 02:27 PM
Registered User
 
Join Date: Sep 2011
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Keyword not supported: 'provider'

Hi,

I did installed ODAC from Oracle Universal Installer as shown in my C:\Windows\assembly version 2.1.1.2.0

Currently, I am trying to use Oracle database for a Web application inside .NET framework. Between this book and its cousin Beginner one, I hope to find some quick help as what I need to add to my Web.config or how to configure my laptop so that .NET will see tables/views/etc. from a remote Oracle DB. I would appreciate any pointer to my issue.

Thank you in advance for your help.

In my Web.config, I have this line in the connectionStrings collection element:
<add name="IMCX" connectionString="Provider=MSDAORA;Data Source=imacs_imcx;Persist Security Info=True;Password=<I-put-my-password-here>;User ID=<I-put-my-Oracle-logon-ID-here>" providerName="System.Data.OleDb" />

In my C# code:
SqlConnection DBCon;
DBCon.ConnectionString = ConfigurationManager.ConnectionStrings["IMCX"].ConnectionString;

Here is the stacktrace
Keyword not supported: 'provider'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Keyword not supported: 'provider'.

Source Error:


Line 29: System.Threading.WaitHandle[] WHandles = new System.Threading.WaitHandle[2];
Line 30: DBCon = new SqlConnection();
Line 31: DBCon.ConnectionString = ConfigurationManager.ConnectionStrings["IMCX"].ConnectionString;
Line 32: UsersCommand.CommandText = "SELECT VUSER FROM WDS49.KWRD_TABLE WHERE GROUP_PASS like '"
Line 33: + profile.ToUpper()


Source File: c:\Users\...\Documents\Visual Studio 2010\WebSites\Gina2\kwrd.aspx.cs Line: 31

Stack Trace:


[ArgumentException: Keyword not supported: 'provider'.]
System.Data.Common.DbConnectionOptions.ParseIntern al(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +5096356
System.Data.Common.DbConnectionOptions..ctor(Strin g connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString) +64
System.Data.SqlClient.SqlConnectionFactory.CreateC onnectionOptions(String connectionString, DbConnectionOptions previous) +24
System.Data.ProviderBase.DbConnectionFactory.GetCo nnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +150
System.Data.SqlClient.SqlConnection.ConnectionStri ng_Set(String value) +59
System.Data.SqlClient.SqlConnection.set_Connection String(String value) +4
kwrd.GetKeywordProfile(String profile) in c:\Users\...\Documents\Visual Studio 2010\WebSites\Gina2\kwrd.aspx.cs:31
kwrd.Page_Load(Object sender, EventArgs e) in c:\Users\...\Documents\Visual Studio 2010\WebSites\Gina2\kwrd.aspx.cs:18
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

Last edited by Flyby09; February 1st, 2012 at 02:37 PM..
 
Old February 1st, 2012, 02:37 PM
Registered User
 
Join Date: Sep 2011
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Additional work on this...unsuccessfully

I changed my C# code to
using Oracle.DataAccess.Client;
...instead of...
using System.Data.SqlClient;

but the compiler did not recognize Oracle... I suspect that it did not see my ODAC???
 
Old February 2nd, 2012, 02:48 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Did you add a reference to the Oracle.DataAccesss.dll assembly?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 3rd, 2012, 11:08 AM
Authorized User
 
Join Date: Jan 2011
Posts: 86
Thanks: 1
Thanked 12 Times in 12 Posts
Default

Hi,

after you have added the reference to Oracle.DataAccesss.dll you'll probably want to change your connectionstring to one that works wit the Oracle Data Provider.
I usually use the following format for the connectionstring:
"Data Source=YourInstanceHere;Persist Security Info=True;User ID=YourUsernameHere;Password=YourPasswordHere"

Hope this helps
 
Old February 3rd, 2012, 12:27 PM
Registered User
 
Join Date: Sep 2011
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to add dll to Visual Studio so that Reference can see it?

Thank you, Irma, for the additional tip.

It seems that you have helped me debugging this headache of mine one-step-at-a-time.

When trying to add the reference, I find out that I did not see any Oracle components available (NOne except Oracle Data Control)????? And, to tell you the truth, I do not know what I expect to see there.

So I click on Tool-> Choose Toolbox Items...
From there I can select (put the check mark on) 4 Oracle components: OracleCommand, OracleCommandBuilder, OracleConnection, and OracleDataAdapter. Still, my C# code still cannot use the needed namespace such as Oracle.DataAccess.Client.

One thing I know for sure that what I added were from .NET framework and not exactly from Oracle as I would hope. More than that, I got a message box saying:
The following assemblies are installed SDK assemblies but could not be shown in the customize toolbox because they are missing one or more components. Please make sure that all neccessary libraries are available:
Oracle.Web.dll
Oracle.DataAcess.dll
Oracle.Web.dll
Oracle.DataAcess.dll
(Yeah, they are repeated like that!)

Where do I get these DLL because they are in multiple places? Searching my C drive, I found that one Oracle.Web.dll is in my Oracle server (yep, I have an Oracle Enterprise server 11g on my laptop) dbhome\ASP.NET\bin\4\ (others in other directories) and several Oracle.DataAcess.dll in various places (one is even in C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle... . but I do not know how to add these libraries into the VisualS Studio.

Any help would be greatly appreciated.
 
Old February 3rd, 2012, 01:23 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Irma?

Anyway, you shouldn't add a reference through the Toolbox, but through the References dialog.

Your project in the Solution Explorer has a References node. Right-click it and choose Add Referene. Here you can browse to the Oracle assemblies.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyword not supported: 'provider' Flyby09 BOOK: Professional ASP.NET 4 : in C# and VB 1 February 14th, 2012 05:15 PM
System.ArgumentException: Keyword not supported: 'provider'. Flyby09 BOOK: Beginning ASP.NET 4 : in C# and VB 2 January 28th, 2012 09:34 PM
ProfileCommon not Supported Chris_Alis BOOK: Professional ASP.NET 4 : in C# and VB 2 September 26th, 2011 02:15 PM
Is this book still supported? JasonRawlins BOOK: ASP.NET AJAX Programmer's Reference : with ASP.NET 2.0 or ASP.NET 3.5 ISBN: 978-0-470-10998-4 1 April 1st, 2009 08:56 PM
Keyword not supported: 'provider'. bam1934 ASP.NET 1.0 and 1.1 Basics 1 May 27th, 2005 12:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.