XML App Settings For DB Connection?

Apr 7, 2011

It seems the code below for user ID and password is not used by my application, but I'm kinda confused at how my application is able to connect to the SQL server with only servername and dbname, because even if I remove the entry in the app.config for user ID and password, the application is still able to connect and return a data set. Can anyone explain how this happens?

[Code]...

View 4 Replies


ADVERTISEMENT

Assign A My.Settings.Item Connection String To Cmd.Connection Connection String Value?

Aug 25, 2009

How do I assign a My.Settings.Item connection string to cmd.Connection connection string value?

Dim cmd As New SqlCommand()
cmd.Connection = My.Settings.Item("csStaffHoursWorked")
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "spSaveDeltekImport"

View 3 Replies

Connection Error When Using Project Settings

Feb 25, 2009

I get this error
Format of the initialization string does not conform to specification starting at index 34.
When I take my connection string and store it in the project settings. I know that this works.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\Employees.accdb

Because if I use it like this
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\Employees.accdb")
conn.Open()

The connection succeeds but if I try this
Dim conn As New OleDbConnection(My.Settings.Default.employeeConnection)
conn.Open()

I get that error.
name:employeeConnection
type:string
scope:application
value:Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\Employees.accdb

View 3 Replies

Connection String In Application Settings

Jan 14, 2010

I'm trying to give my users the option to move their database to a different location, currently the datasource is set as an (Application Connection String) in the Project Settings, I know that when the scope is set to "Application" it cannot be modified but I'd like to know if there's a way for me to edit the location through code of my database in the application settings without crashing the program, can this be done? The purpose is to give whoever uses my application the freedom to choose where the database should be.

View 3 Replies

IDE :: Missing Connection Strings In Application Settings

Nov 11, 2010

I am using VB 2008 & MS Access 2007 Databases for my Windows Forms Applications.The Problem is my Connection strings have been disappeared from DataSource Configuration Wizards & now i am unable to edit any Connection String in DataSet Designer.I had tried to create a Macro in MS Access Data File but didn't know how to create & so desided not to save any & just quit from Access and came back to Visual studio. Since then only this prob. has started. Earlier to this everything was just fine.I have tried to uninstall MS Office as well as Visual Studio then Re-installed Visual Studio but the problem is still there.

1] Error while trying to Reconfigure Data Adapter in Dataset

2] Disappeared options & Empty Connection Combo Box

3] Add Connection DialogBox with no DataSource property line in the Grid control

View 2 Replies

Settings Is Readonly/ Changing Connection String?

Mar 2, 2006

This is regarding a windows app in Visual Studio 2005, a VB Windows application.'ve stored a connection string called strSQLConn in My.Settings. I'm trying to change the Server in code. I set a string variable called strConn to a new Connection string. My.Settings.Profile2006sql = strConn

This produces an error saying that My.Settings is readonly. I'm missing something basic here.

I don't know if this is the best way to change a connection string to toggle between a development server and a production server. My understanding is that if the setting Connection string is changed it will be used as the default for all the table adapters in a strongly typed dataset. Is that the case?

View 10 Replies

Change Connection String Saved In My.Settings In Program?

Jan 30, 2012

I am writting an application and I used Wizard to create DataSets which auto-created their own xml code. This code uses the saved in My.Settings Connection String. Being a setting with an unchangable 'Application' scope i cannot change its value at runtime.

The problem is that when I install the Application to my customer the Connection String will have to change (maybe more than once). So is there a way to change the Connection String used by these objects at runtime ?

View 1 Replies

Cryptography Classes To Encrypt And Decrypt Connection Settings?

Apr 29, 2010

I have used System.Security.Cryptography classes to encrypt and decrypt connection settings but have a question regarding securing the private key needed to decrypt. Given that assemblies can be easily read, what is the preferred method for storing the private key so that it is not visible to anyone who goes looking?

View 1 Replies

Override The Design Time Connection Settings Of Crystal Reports

Nov 5, 2009

I�m converting some Crystal reporting functions from VB 6.0 to VB .Net 2008, have reports up and running, and I�m not quite sure how to approach one aspect. The issue I have is most of the Crystal reports connect to a database and run a stored procedure. The connection properties are set up in the report usually pointing at the development region. At run time I need to be pointing to either development, user acceptance, or production. I know what environment I�m in from a configuration file but don�t know how to go about telling Crystal what environment and stored procedure to point at. In VB 6.0 it was:

CR1.Connect = "DSN=" & A.ReportServer & ";<<Use Integrated Security>>;DSQ=" & A.ReportManhattanDB
Where A.ReportServer and A.ReportManhattanDB contain the connection poperties. The stored procedure is passed via:

[Code]....

View 3 Replies

Storing A Database Connection String Into Settings In A .net DLL Data Layer?

Mar 4, 2011

I've always used this approach while implementing data layer DLL for web application:

1) put datasets into the dll project
2) use a helper class with a method like this:

public shared sub settCnnStr(strconnhere as string)
My.Settings.Item("connectionString") = strconnhere
end sub

3) when I need to use the dll I call a method like this (usually into global.asax):

xxxxxxx.helper.setCnnStr("yyyyyyyyyyyyyy")

This method always worked for me nicely but I'd like to know if this method could have serious drawback or if there's a better solution.

View 1 Replies

VS 2005 Save Settings Database Connection And ComboBox Selection?

Jan 15, 2010

I have a program that reads a database file(.csv or.Txt) then allows user to select data from 6 different comboxes and taext boxes are then populated based on the selection made from combobox

I would like to be able to give the user the option to save their settings so next time the program is open it will connect to the same database as the last connection and also have comboboxes go to the last selection Do I have to create a save setting value for each combobox? and the connection string?

is there a simple way to just save everything? so when the program is open it goes back to the last time it was open.

View 11 Replies

VS 2008 - Store The Connection String In A Settings Table In The Database?

Apr 20, 2010

I am storing my connection string in my app.config file. I am using sql server express 2005. The connection string on my dev machine is different from the ones at the clients. so each time I update I open the config file and edit the connection string setting. This is quite a pain.also I have now published my app to an ftp folder so that the clients can get the updates each time I make changes. saves me the hassle of going to them each time i update. so now i need it to be so that I won't have to change the setting all the time.Would the best way be to store the connection string in a settings table in the database?

View 6 Replies

My.Settings.Upgrade Stopped Preserving Settings After Visual Studio And Framework Were Upgraded?

Jan 13, 2011

The company has been using Visual Studio 2008 and .NET Framework 2.0 for approximately 2 years. During that time we released several versions (4.x.x) of our program to the public and were able to preserve the user's settings using My.Settings.Upgrade.During the past development cycle we upgraded the program to Visual Studio 2010 and .NET Framework 4.0 and changed the version to 5.x.x. Now, when a user upgrades from 4.x.x to 5.x.x they lose all of their settings.However, in all upgrades after that point (ie 5.0 to 5.1) all the user's settings are once again preserved.I checked C:Documents and Settings<USER_NAME>Local SettingsApplication DataCompanyName and it contains two directories:

ApplicationName_Url_aaa ApplicationName_Url_bbb

where aaa and bbb are 32 character strings. All of the user.config files for the 4.x.x releases can be found in the ApplicationName_ Url_aaa directory. All of the user.config files for the 5.x.x releases can be found in the ApplicationName_Url_bbb directory.Based on this information it seems like something changed when we converted our program to VS2010 and Framework4 that is now causing a different 32 character string to be generated. However, we have been unable to track it down.

View 9 Replies

Unable To Make Some Settings And Load The Result Of The Settings Via LinQ Into The Grid Of The UscStat?

Jan 3, 2012

I have the following structure:OLD: frmMain (WinForm)uscStat (UserControl with Grid) In frmMain I'm able to make some settings and load the result of the settings via LinQ into the Grid of the uscStat.

[Code]...

View 1 Replies

Application.Settings VB 2005 - Save Arrays Using The Settings System Object

Jan 14, 2009

I just wondered if you can or can't save arrays using the settings system object. There seems to be no way of entering it at designtime. It seems implied you cannot create new user settings.subobjects at runtime. I'm looking to find the easiest way to save a populated array of PictureBox's. If the only way is a self/custom made/managed .ini file then I need to know so i can start on that but I was hoping to use some of all this phaff in the new frameworks usefully.

View 3 Replies

ClickOnce Overwrites User Settings Settings .NET 2008 Cant Use Registry UAC Causes Error

Aug 5, 2009

I am rewritting my application to conform to ms standards. We used to save all settings to registry for user settings, servername, size and locations.so we are now saving them into My.Settings app.config the only problem is that each time there is an update clickonce will isntall the newupdate but now all settings are loist and user has to save everything all over again..

I am trying to follow the book here but it seems i keep getting stuck somewhere. registry has worked fine for years but i understand we must move on, but if stuff like this happens then i just wasted a long time converting all code to conform for it to not work..

View 1 Replies

How To Maintain Application Modified Settings In The Settings Files After A Program Update

Sep 8, 2009

Is there a way to maintain application modified Settings in the settings files after a program update? i.e. I have 10 or so values in the settings file and the users can modify them... when I send a program update they revert back to what I initially programmed them to be.

View 3 Replies

Application.restart After My.settings.save Doesn't Load The New Settings

Feb 8, 2008

i have created a user setting named 'setmeup' as string, scope = user, value = "magical meow meow!".in my code i access it and assign it a new value like this...my.settings.setmeup = "howdy cowboy!"my.settings.save()application.restart()when the application restarts, i expect the my.settings.setmeup = "howdy cowboy!" but when i check its contents its still "magical meow meow!".but when i use application.exit() instead of application.restart() and manually restart the program, my.settings.setmeup = "howdy cowboy!" which is correct.what must i do? i want to use application.restart() because i don't want the users to double-click the icon again to start the program. i want the program to restart automatically.

View 2 Replies

VS 2010 - My.Settings - Can't Find File Which Reflects Changes To User Settings

Apr 15, 2011

1. I can't find the file which reflects changes to user settings. This might be because I just can't find it (I can see a bunch of user.config files but they are all empty - weird!), or...

2. I'm not actually saving them when I think I am.

Regarding 2. - do I need to invoke

Is this all I need? And if so, why are my user.configs empty?

View 1 Replies

VS 2010 Save The Treeview Items To Settings (my.settings.history)?

Mar 25, 2011

I'm working with an Treeview and i'm new at it and i have 2 questions.

1. How can i save the treeview items, to settings (my.settings.history)

2. How can i save the treeview items as an TXT or XML file or another exception.

View 13 Replies

Difference Between Standard My.settings And Adding A New Class That Is Of Settings?

Mar 3, 2009

my old vb6 program used to store to ini files now with .net I rekon I need to do something new.. was thinking XML but then in searching around I stumbled apon this my.settings stuff.. so I followed the instructions but something strange is going one..

1. whats the difference between the standard my.settings and adding a new class that is of settings ? anything ?

2. I made 10 new settings in the setting manager but when I try to change then it gives me the old squiggle line saying no go.

View 15 Replies

VS 2008 Settings Are Read From App.config Instead Of Settings-file

Oct 30, 2009

I have created a settings-file for my plug-in-based app. When the mainApp writes the settings to the file, the pluginApp should read the settings from the settings-file (when opening or at runtime even better), but somehow it reads the settings from the app.config-file. This means that the pluginApp never will read the settings according the values of the file.

View 4 Replies

VS 2008 Using 'Settings File' (Settings1.settings)

Aug 5, 2009

I saw that you can also use a "Settings File" (Add new Item)to add your settings instead of the application settings. But I can't seem to write any values to the file. Someone with experience with the "Settings1.settings"?

View 2 Replies

VS 2010 - Settings.settings Saved Into The Registry?

Jun 11, 2010

Small questions about the settings.settings. Are these settings saved into the registry? I'm want to use and external file for my connection-commands. I don't want to use the registry to store the strings. What do you recommend?

View 11 Replies

Add Custom Settings To The My.Settings Namespace

Mar 18, 2010

Add custom settings to the My.Settings namespace

View 7 Replies

Changing Settings.settings Not Working

Apr 19, 2012

I can double click on the Setting.settings and the projects Settings grid appears in design. I change the value of a user scope setting yet when I run the application in debug it picks up a value I set initially instead of the current value of the setting.

When the app starts I set a connection string to the path of the .SDF file that I set in the Settings.settings grid and accesss it with

mRootSDFPath As
String =
My.Settings.SDFConnectionString

[Code].....

View 6 Replies

Create Dynamic Settings Using My.Settings?

Apr 7, 2010

it is possible to create dynamic settings using My.Settings.For example, a person clicks "Add User"The program then creates the settings for that user, it creates User(DYNAMICNUMBER)FN, and User(DYNAMICNUMBER)LN. Where Dynamic number is the next user for no conflicts in the settings. Is this possible? So that you can save multiple users for example?

View 2 Replies

Reset User Settings In My.Settings?

Jun 29, 2010

how to reset user settings in My.Settings to the default value, because when i checked if the user settings works i have altered the settings so now i want the settings to go back to default, because i am going to distribute the software.

View 1 Replies

Save User Settings Using My.Settings?

Jun 8, 2010

how i can save user settings in vb.net

i have a project with different buttons when a user clicks a button the image of PictureBox1 will change.

i want to save this image that the user has chosen after he closes the application, so it will be displayed in PictureBox1 when loaded.

i am using Microsoft Visual Basic 2010 Express

the languge is VB

View 5 Replies

Saving Printer Settings In My.settings?

Jul 15, 2009

I'm having trouble getting the objects of the PageSetupDialog and the PrintDialog to persist in my.settings Is there an example of this anywhere? Seems like it should be something there is a boiler plate for so I can see where I have gone wrong.Added a System.Drawing.Printing.PageSettings and System.Drawing.Printing.PrinterSettings entries in my.settings but even trying to save these form the results of the dialogs they show as nothing with out a error.




View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved