Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Error opening DataSet designer: Key not valid for use in specified state
 

Error opening DataSet designer: Key not valid for use in specified state

I am getting this error when opening a DataSet designer (.xsd file):

Key not valid for use in specified state.

at Microsoft.VisualStudio.Data.DataProtection.DecryptString(String s)
at Microsoft.VSDesigner.VSDesignerPackage.AppSettingsHelper.AddServerExplorerConnections(IServiceProvider serviceProvider, IList connections)
at Microsoft.VSDesigner.VSDesignerPackage.GlobalConnectionService.Microsoft.VSDesigner.VSDesignerPackage.IGlobalConnectionService.GetConnections(IServiceProvider serviceProvider, Project project)
at Microsoft.VSDesigner.DataSource.DesignConnection.GetConnectionFromAppSettings(String objectName, String propertyName)
at Microsoft.VSDesigner.DataSource.DesignConnection.get_ConnectionStringObject()
at Microsoft.VSDesigner.DataSource.DbSource.set_Connection(IDesignConnection value)
at Microsoft.VSDesigner.DataSource.DesignDataSource.SetConnectionProperty(Source source)
at Microsoft.VSDesigner.DataSource.DesignDataSource.ReadXmlSchema(DataSourceXmlTextReader xmlReader)
at Microsoft.VSDesigner.DataSource.DesignDataSource.ReadXmlSchema(TextReader textReader)
at Microsoft.VSDesigner.DataSource.Designer.DataSourceSerializationService.DeserializeToDataSource(String filePath, Object serializationData)
at Microsoft.VSDesigner.DataSource.ProjectDataSourceDescriptor.LoadDataSource()
at Microsoft.VSDesigner.DataSource.ProjectDataSourceDescriptor.Init(IServiceProvider provider, IVsHierarchy primaryHierarchy, UInt32 primaryItemId, Object primaryDocDataObject, UInt32 docCookie, IVsInvisibleEditor invisibleEditor, IDesignerHost host)
at Microsoft.VSDesigner.DataSource.ProjectDataSourceStorage.EnsureInvisibleEditor(ProjectItem dsProjectItem, Boolean ensureWritable, Boolean createInvisibleEditor)
at Microsoft.VSDesigner.DataSource.ProjectDataSourceStorage.GetDataSourceInternal(Object caller, ProjectItem dsProjectItem, Boolean ensureWritable, Boolean createInvisibleEditor)
at Microsoft.VSDesigner.DataSource.Designer.DataSourceDesignerLoader.HandleLoad(IDesignerSerializationManager serializationManager)
I have all my datasets in the same Project. The datasets reference a connection string in the app.config file. I have tried deleting this connection string and recreatingit but that did not help. Also, my account has just been migrated from non Active Directory domain to an Active Directory domain and my profile has been migrated as well. I suspect this may have caused the problem but I cannot find a solution. Everything else works except opening datasets.
Any help would be appreciated.

DG2  Monday, July 17, 2006 9:29 AM

I don't know if you'vegot an answer yet, but for my part the solution was the following:

Deletethe data connectionthe dataset is basedupon ("Data Connections" in Server Explorer),reconnect it and it should be working again.

Jacquiero  Tuesday, July 25, 2006 11:37 AM

The workarround was really funny

I just deleted the connection from Server Explorer, now when i reopen the datasets they work fine....

If any other solution please inform

inknanand  Tuesday, March 27, 2007 1:57 PM
it's works for me. Thanks.

carlosern  Tuesday, September 02, 2008 7:10 PM
Jacquiero wrote:

I don't know if you'vegot an answer yet, but for my part the solution was the following:

Deletethe data connectionthe dataset is basedupon ("Data Connections" in Server Explorer),reconnect it and it should be working again.

inknanand wrote:

The workarround was really funny

I just deleted the connection from Server Explorer, now when i reopen the datasets they work fine....

If any other solution please inform

Just had the same problem myself. Deleting and reestablishing the database connections worked perfectly. Thanks.

Odinsonnah  Wednesday, October 22, 2008 2:01 PM
Solution worked perfectly for me. Thanks guys, it was driving me crazy!!!
Crowie  Wednesday, November 12, 2008 12:09 PM
great.. it works...
Data Connections in Server Explorer was no were related to the Dataset, but deleting makes it work :)
Chandreshwar  Tuesday, September 22, 2009 4:14 PM

You can use google to search for other answers

Custom Search

More Threads

• How do I test if a datagridview has changed?
• DataGridView: Column error for Binary, VarBinary, LongVarBinary data fields
• DataGridViewComboBoxCell
• Datarow
• Automatic sizing of column width based on text length
• current cell changed
• About DataGrid
• How can I get data binding to work with a ListBox.SelectedItem
• Please HELP!!
• Hide a column in datagridview but still access data in column.