none
Keyword not supported: 'provider'

    Question

  • An unhandled exception of type 'System.ArgumentException' occured in system.Data.dll
    Additional information: Keyword not supported: 'provider'.


    I get this error in my visual basic code using the new full version of 2005. The error is on form load for this line



    sqlConn.ConnectionString = SQLCnString


    The string variable is assigned in the declaration section. I dont know what the problem could be because the same sqlconnection string is used in other programs with no problems. The program I am working on I updated from the beta 1 version and I changed the ado connections it had to the sqlclient class connection tools. Im not sure if this has anything to do with the problem but I thought I would bring it up. I have searched this error on google aswell and all I found was unawnsered posts on other forums.

    Also this is my connection string which shouldnt be the problem:
    Provider=SQLOLEDB.1;Integrated Security=SSPI;DATABASE=AFW_APInquiry;SERVER=SqlServer


    Thanks
    Tuesday, November 08, 2005 2:40 PM

Answers

  • When you are using a specific provider (SqlConnection in this case) you can not specify the Provider (as the provider-specific Connection object is the provider).  Remove the Provider value from your connection string.  If you are using the generic OleDbConnection then you should use the Provider value so ADO.NET knows what provider to instantiate.

    Michael Taylor - 11/8/05
    Tuesday, November 08, 2005 2:51 PM
    Moderator

All replies

  • When you are using a specific provider (SqlConnection in this case) you can not specify the Provider (as the provider-specific Connection object is the provider).  Remove the Provider value from your connection string.  If you are using the generic OleDbConnection then you should use the Provider value so ADO.NET knows what provider to instantiate.

    Michael Taylor - 11/8/05
    Tuesday, November 08, 2005 2:51 PM
    Moderator
  • Thanks alot. And thanks for replying so fast, its nice having forums were you dont have to wait 2 days to get a reply.
    Tuesday, November 08, 2005 3:03 PM
  • hi,

    i understand all these but how bout this error?

    Line 19:         {
    Line 20: // 1. Instantiate the connection
    Line 21: SqlConnection conn = new SqlConnection("Data Source=NOTEBOOK\\SQLEXPRESS;Initial Catalog=crsm;Integrated Security=True");
    Line 22: SqlDataReader rdr = null;
    Line 23:

    notebook is my laptop where i develop my program in asp. i'm wondering why is this problem occur where i am not using any provider specific-string nor oledb (since i'm using sqlconnection) is this a bug or something?

    thanks!

    by the way this is a class-based program that i imported in my asp website.


    Friday, May 11, 2007 3:36 AM
  • hi,

    i understand all these but how bout this error?

    Line 19:         {
    Line 20:             // 1. Instantiate the connection
    Line 21:             SqlConnection conn = new SqlConnection("Data Source=NOTEBOOK\\SQLEXPRESS;Initial Catalog=crsm;Integrated Security=True");
    Line 22:             SqlDataReader rdr = null;
    Line 23:

    notebook is my laptop where i develop my program in asp.  i'm wondering why is this problem occur where i am not using any provider specific-string nor oledb (since i'm using sqlconnection)  is this a bug or something?

    thanks!

     

    ps

     

    by the way this is a class-based program that i imported to be used in my asp.net coded website.

    Friday, May 11, 2007 3:39 AM
  • Thanks a lot
    Prabakar
    Friday, May 08, 2009 6:55 AM
  • When you are using a specific provider (SqlConnection in this case) you can not specify the Provider (as the provider-specific Connection object is the provider).  Remove the Provider value from your connection string.  If you are using the generic OleDbConnection then you should use the Provider value so ADO.NET knows what provider to instantiate.

    Michael Taylor - 11/8/05

    hi

    when I got this Error I removed the provider But Now I have another  Problem that now it can not

    determain my tables and I get This Error:

     

    Invalid object name 'Magazine'.

    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.Data.SqlClient.SqlException: Invalid object name 'Magazine'.

    Source Error:

     

     

    please Help me it is urgent

    Thursday, January 27, 2011 11:03 AM
  • Hi, I am also getting this same error when my asp application has been uploaded to my host site. I am using Visual Studio 2010 with MS Access 2010.

    This is my connection string in my web.config file 

     <add name="ConTrakDB" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\inetpub\wwwroot\sj10abs\db\ConTrakDB.accdb;" />

    I use the below connections in aspx files 

                     <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConTrakConnection %>" 
                        ProviderName="<%$ ConnectionStrings:ConTrakConnection.ProviderName %>" 
                        SelectCommand="SELECT DISTINCT [Username] FROM [Timecards]"></asp:SqlDataSource>

    and 

     Dim oledbconn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("ConTrakDB").ConnectionString) in the aspx.vb files. I have looked around at other forums for this error but cant find where I am using a SQLconnection other than the datasources in the aspx files. Could it be this causing the error?

    Many thanks 

    Sheena

    Monday, December 24, 2012 4:48 PM
  • I'm also getting same error :(
    i'm new to c# and .net programming ... please guide me :(
    i'm using Visual studio 2010 and sql server 2000 on windows xp.

    here is my connection string ............

    string mySqlStr = "Provider=SQLOLEDB;Data Source=MASTERDEVELOPER;Integrated Security=SSPI;Initial Catalog=Al-Noor";

            here is my code...

    mySqlConn = new SqlConnection(mySqlStr);
                    mySqlConn.Open();


    thanks in advance :)

    Sunday, October 06, 2013 2:04 PM