开发者

Can't get rid of a deleted Settings reference in DataSet.Designer.vb

I had a connection string to a MS Access DB file, Foo.accdb, defined and used in my project. It was defined as a connection string Setting in the Settings section of my project properties. The program referenced the connection string setting and everything worked fine.

Then I decided to replace Foo.accdb with two different DB files, A.accdb and B.accdb each of which would be used under different circumstances. I added connection strings for them in Se开发者_高级运维ttings and removed the Setting definition for Foo.accdb connection string.

The name of my application is Foo and the name of the Foo.accdb connection string was FooConnectionString.

But now when I build the program both in debugger and for release I get the following error message:

'FooConnectionString' is not a member of 'Foo.My.MySettings'.  

The offending reference, in file FooDataSet.Designer.vb, is:

    <Global.System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
    Private Sub InitConnection()
        Me._connection = New Global.System.Data.OleDb.OleDbConnection
        Me._connection.ConnectionString = Global.Foo.My.MySettings.Default.FooConnectionString
    End Sub

What is going on here? FooConnectionString is not in any other file in the project directory nor in the My Project subdir. I completely got rid of it in my code and in my project properties yet it persists in FooDataSet.Designer.vb (whatever that is).

While researching this on the web I saw a recommendation to select the FooDataSet.xsd file, right click it and execute the "Run Custom Tool" option. I did this and it appears to rebuild FooDataSet.Designer.vb (the time stamp changes) but the problem persists.

I also tried removing the offending reference by manually editing FooDataSet.Designer.vb but that gave me some other error message.

Why is this old reference staying around and what can I do about it?

This is a standalone app. I'm using VS2008 Standard Ed., VB.Net 3.5

Thanks.


Open the FooDataSet XSD file in a text editor. Right click on dataset in the solution explorer and select "Open With..." and the select XML (text) Editor or open it outside the solution.

Look for the <Connections> tag near the top of the file. Remove the line that looks like this

<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="FooConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="FooConnectionString(Settings)" ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜