Following exception is being thrown on a particular user desktop only while initiating the application.
Let me know if any one of you knows the workaround for this exception:
Message: HandlingInstanceID: c48656c1-2793-4cab-b379-e1aeaffd9340
An exception of type 'System.InvalidOperationException' occurred and was caught.
Type : System.InvalidOperationException, mscorlib, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The ConnectionString property has not been initialized.
Source : System.Data
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void PermissionDemand()
Stack Trace : at System.Data.SqlClient.SqlConnection.PermissionDemand()
at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
It's a bit hard to go on the little details you've provided.
The PermissionDemand() in there together with the fact this only happens on one desktop suggests that there is a permissions problem somewhere.
Is the user that is getting this problem running as local admin or just a standard user? If a standard user, does an domain admin get the same problem?
Thanks for your response. I tracked down the problem myself and identified this with an issue within the registry entries being added when you create a System DSN using ODBC Data Source.
Earlier my application (client/server) used to fetch the connection string thru app.config and to make it more generic and independant of any changes being required to be made to app.config we decided to form the connection string by fetching the DSN entries being created in the local registry.
We basically decided to fetch the 'Database' and the 'Server' keys from the registry to form the string. But, when you specify windows authentication as your mode of authentication while creating the DSN it does not create a KEY - 'Database' within your registry. It creates it only when you choose SQL Server (we are using SQL Server 2005) authentication.
I didn't understood the logic behind this though?
I am having the same problem but I didn't understand a word you just said. I am obviously a little new at this, but I try to figure most things out first by reading other post, hence why I am here. But this one is just over my head. the source code is as follows, thanks in advance.
PublicClass Form1 Dim theOleDbCommand As New OleDbCommand() Dim theOleDbDataAdapter As New OleDbDataAdapter(theOleDbCommand) Dim theDataSet As New DataSet()
this is just a sample app that I am working with, I will eventually use it integrated with a user input form, if at all possible. I have the other app made, it is like a time card application. Just thought I would try a sample first and can't get it. I don't know if any of that helped.
i was facing the same issue while troubleshooting someone's code. but in my case, the code was written in a way that it was entering the transaction, execute some code, commit transaction, and execute some other code without exiting the transaction.
when i moved my code inside the transaction it worked fine.
hope this helps if u r having same issue.
guys...Please stop speculating on this like MVPs.....:))))))))))))))))),
I could reproduce with a strong point, If there is an exception occurred, if you have rolled back your transaction, and try to continue the further data retrieval, Connection is Closed, so the error.
if you want more details about your bug, In VS IDE, keep exception ON. ( Debug --> Exceptions, check on exceptions... )you would see the dirty code which causing this error !