Note that there are some explanatory texts on larger screens.

plurals
  1. POKeyword not supported: 'provider' in ConnectionString in the web config
    primarykey
    data
    text
    <p>I am having issues accessing my ConnectionString in the web config.</p> <p>Here is my web config.</p> <pre><code>&lt;configuration&gt; &lt;appSettings/&gt; &lt;connectionStrings&gt; &lt;add name="UAFConnectionString" connectionString="Provider=SQLOLEDB;Data Source=INLISAP003;Password=5q1server2005;User ID=sa;Initial Catalog=UserAccessForm" providerName="System.Data.OleDb" /&gt; &lt;/connectionStrings&gt; </code></pre> <p>Here is my code for the button click,</p> <pre><code>Imports System.Data Imports System.Data.SqlClient Imports System.Configuration Partial Class _Default Inherits System.Web.UI.Page Dim mySqlCon As SqlConnection Dim strConnection As String Sub OpenCon() strConnection = ConfigurationManager.ConnectionStrings("UAFConnectionString").ConnectionString mySqlCon = New SqlConnection(strConnection) mySqlCon.Open() End Sub Sub CloseCon() mySqlCon.Close() mySqlCon.Dispose() End Sub OpenCon() Dim SQL As String = "SELECT * FROM tbl_UserAccount WHERE StafID='" &amp; txtUsername.Text &amp; "' AND Password='" &amp; txtPassword.Text &amp; "' " Dim DR As SqlDataReader Dim CMD As New SqlCommand(SQL, mySqlCon) DR = CMD.ExecuteReader(System.Data.CommandBehavior.CloseConnection) DR.Read() If DR.HasRows = False Then MsgBox("Invalid User name OR Password", MsgBoxStyle.Critical, "Login ERROR") txtUsername.Focus() Exit Sub End If </code></pre> <p>Here is my error message.</p> <blockquote> <p>System.ArgumentException: Keyword not supported: 'provider'. at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions&amp; userConnectionOptions) at System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) at System.Data.SqlClient.SqlConnection..ctor(String connectionString) at _Default.OpenCon() in D:\WEB-SITES\PROJECT002\Default.aspx.vb:line 12 at _Default.btnLogin_Click(Object sender, EventArgs e) in D:\WEB-SITES\PROJECT002\Default.aspx.vb:line 35</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload