2

The C# code is:

DataContext db = new DataContext(MyProject.Properties.Settings.Default.MyString)

I am trying to convert this app to VB.NET but VB.NET does not seem to have a .Properties on the project. I am probably confused about what that C# is actually doing. I assumed it was trying to get the string out of the app.config (both versions have the same app.config) or out of Settings.settings in the Properties folder.

Visual Basic does not have a properties folder though, only a My Project folder.

Any ideas? I am using Visual Studio 2010.

2 Answers 2

2

You are almost there. When you add a new setting, you can get access to it my going to My.MySettings.Default.MyString in Visual Basic.

0
2

You can try My.Settings , that is what I seem to be using in VB.Net currently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.