Problem in connection
-
Dear All, I am working on a web site when i loading my web application the following error is acquiring i have written con in web.config file of web site and i am using OLEDB provider An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Kindly tell me what should i do?
-
Dear All, I am working on a web site when i loading my web application the following error is acquiring i have written con in web.config file of web site and i am using OLEDB provider An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Kindly tell me what should i do?
Did you written those code inside
Try-Catch
Block ? Could you please post those line of code ?cheers, Abhijit
-
Dear All, I am working on a web site when i loading my web application the following error is acquiring i have written con in web.config file of web site and i am using OLEDB provider An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Kindly tell me what should i do?
Does this error happen locally, or just when deployed ? Perhaps it's that the deployed site can't see the database ?
Christian Graus Driven to the arms of OSX by Vista.
-
Did you written those code inside
Try-Catch
Block ? Could you please post those line of code ?cheers, Abhijit
I have written on load event of form where i am opening conncetion like con.open() on this line this error is acquiring An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Additional information: The ConnectionString property has not been initialized.
-
I have written on load event of form where i am opening conncetion like con.open() on this line this error is acquiring An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Additional information: The ConnectionString property has not been initialized.
sajjadlashari wrote:
con.open() on this line this error is acquiring
Yes, It seems the Issue is with your connection string. Please verify the connection string name, database Server Name, and User id and password.
cheers, Abhijit
-
Does this error happen locally, or just when deployed ? Perhaps it's that the deployed site can't see the database ?
Christian Graus Driven to the arms of OSX by Vista.
I am working on standalone computer locally
-
I am working on standalone computer locally
OK, so when does the error occur ? Does any code run ?
Christian Graus Driven to the arms of OSX by Vista.
-
sajjadlashari wrote:
con.open() on this line this error is acquiring
Yes, It seems the Issue is with your connection string. Please verify the connection string name, database Server Name, and User id and password.
cheers, Abhijit
I have checked it again every thing is alright i also connected with an other server but still is same problem. Dim con As New OleDb.OleDbConnection con.ConnectionString = " DataSource = ABC; InitialCatalog = XYZ; Username = sa; Password = sa" This is the line of code where error is acquiring.
-
OK, so when does the error occur ? Does any code run ?
Christian Graus Driven to the arms of OSX by Vista.
yes when i run the code and try to debug the connection to verify connection on form load event then error is acquiring.
-
yes when i run the code and try to debug the connection to verify connection on form load event then error is acquiring.
OK - the first thing to do in this case, is to debug the code and work out what line blows up. The next, is to post the line and your connection string, etc., if you can't work out the issue.
Christian Graus Driven to the arms of OSX by Vista.
-
I have checked it again every thing is alright i also connected with an other server but still is same problem. Dim con As New OleDb.OleDbConnection con.ConnectionString = " DataSource = ABC; InitialCatalog = XYZ; Username = sa; Password = sa" This is the line of code where error is acquiring.
sajjadlashari wrote:
Dim con As New OleDb.OleDbConnection con.ConnectionString = " DataSource = ABC; InitialCatalog = XYZ; Username = sa; Password = sa"
It should look like con.ConnectionString="Data Source=Database_Server_Name/IP;Initial Catalog=DataBase_Name;Integrated Security=True;User ID=UserID;Password=Password;" ;
cheers, Abhijit