Hi Experts,
I'm trying to open a connection to
sql server using sqlclient class. I'm getting the following error:
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 25: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 26: loConn = New SqlConnection
Line 27: loConn.ConnectionString = "Provider=sqloledb;Data Source=servername;Initial Catalog=
database name;User Id=sa;Password=sa"
Line 28:
Source File: C:\Inetpub\wwwroot\Test\TestFr.aspx.vb Line: 27
Stack Trace:
[ArgumentException: Keyword not supported: 'provider'.]
System.Data.Common.DBConnectionString.ParseInternal(Ch ar[] connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) +114
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +13
System.Data.SqlClient.SqlConnectionString.ParseString( String connectionString) +96
System.Data.SqlClient.SqlConnection.set_ConnectionStri ng(String value) +11
WaliTest.WebForm4.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\Test\TestFr.aspx.vb:27
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +772
The error is in the line where i try to assing the connectionstring. The same code works on one machine and not on other. Could someone pls help?
Thanks in advance..