简体   繁体   中英

Multiple locations for connection string in C# winforms visual studio?

When I go to add a project data source for my datagridview there are multiple connection strings to choose from on the choose your connection page. I have already deleted the multiple strings out of the app.config and tried deleting my dataconnection all together.

They are still there. Where am i missing?

thanks!

The connection strings you see are the ones that are defined as "Data Connections" in the Visual Studio Server Explorer window. You can delete entries from there that you no longer need. (View -> Server Explorer, or CTRL-ALT-S in VS2010.)

These are stored globally, in this file:

%appdata%\Microsoft\VisualStudio\10.0\ServerExplorer\DefaultView.SEView

You can just delete that if you want to get rid of them all, or try to edit it; for some silly reason it's formatted as a SOAP message. (The nodes you want are <DataViewNode> elements.)

Make sure you remove them from your projects first, though; from what I have seen, if you open a project that uses a data connection that you don't already have defined, it will be added into your Server Explorer list automatically.

If you deleted them from the places you've said and you've deleted them from under your project Properties, DataSources folder the only other place I can think of is on the actual Form itself.

You'll either see the datasources listed in the component tray beneath your form in the designer or you could open up your form's .Designer.cs file and do a find for the datasource names you are seeing in the DataGridView wizard.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM