Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Professional ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 4 in C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470502204
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 27th, 2012, 12:44 PM
Registered User
Points: 39, Level: 1
Points: 39, Level: 1 Points: 39, Level: 1 Points: 39, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2011
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Keyword not supported: 'provider'

Hi,

If this is a novice question, I apologize, but I need to post my question on both the Beginner and Professional books, since I do not know which category it belongs to.

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; January 27th, 2012 at 12:47 PM.
Reply With Quote
  #2 (permalink)  
Old February 14th, 2012, 04:15 PM
Friend of Wrox
Points: 742, Level: 10
Points: 742, Level: 10 Points: 742, Level: 10 Points: 742, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2009
Location: Tehran, Iran
Posts: 156
Thanks: 13
Thanked 16 Times in 16 Posts
Smile

Quote:
Originally Posted by Flyby09 View Post
<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;
as you mentioned you are using System.Data.OleDb provider, so in your C# code you should write:

Code:
OleDbConnection conn = new OleDbConnection(ConfigurationManager.ConnectionStrings["IMCX"].ConnectionString);


also see
http://www.connectionstrings.com/oracle#p20
and then try:
Code:
OleDbConnection conn = new OleDbConnection(ConfigurationManager.ConnectionStrings["IMCX"].ConnectionString);
also you can change connection string and then try
(http://www.connectionstrings.com/oracle#p19)
Code:
System.Data.OracleClient.OracleConnection conn;
conn.ConnectionString = ConfigurationManager.ConnectionStrings["IMCX"].ConnectionString);
__________________
happy every time, happy every where

Reza Baiat

Last edited by irProject; February 14th, 2012 at 04:20 PM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
System.ArgumentException: Keyword not supported: 'provider'. Flyby09 BOOK: Beginning ASP.NET 4 : in C# and VB 2 January 28th, 2012 08: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
multivalue paramaters are not supported diegoo BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 February 20th, 2005 01:30 AM



All times are GMT -4. The time now is 10:32 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.