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


ADVERTISEMENT

Best Option To Store Database Connection String?

Apr 1, 2009

I just want to know what is your suggestion about storing database connection strings in .NET? I am using My.Setting usually, but now I am facing with versioning of my application. When I upgrade my application to higher version the value in My.Setting has been changed, it didn't remain as user has set before, but changed base on my machine's setting. eg. the value in My.Settings Version 1.0.0.0 (User's computer) is 'ABC' When I develop again some new feature on my machine and set its version to 1.0.0.2, of course the connection string in my computer's My.Setting file is different with User's computer's My.Setting. So when I copied my recent updated file to use's computer, then run the application, the application read the new My.Setting file from my computer but not from their computer. the value in My.Settings Version 1.0.0.2 (Developer's computer) is 'DEF' Therefore I have to reset and reset their connection strings onve I updated their application, that's too annoying?

View 16 Replies

[2008] Store Comnnection String In My.Settings?

Jan 12, 2009

how to store the connection string to my Access mdb in my project's My.Settings ?

View 4 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

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

Store The Connection String In Microsoft Visual Studio 2008?

Aug 15, 2011

i m using Microsoft VS 2008 and in that VB.NET as the language the problem is i m not able to store connection string every time machine changes have to keep on changing the connection string

View 7 Replies

Store The Settings In A Text File Or Database?

Jan 2, 2010

I'm working on a project right now that basically prints a string to the field that has focus in internet explorer and there's quite a bit of user specified information that needs to load when the vb program loads. Should I use a text file to store and retrieve the settings or a database? I'm a new programmer and I don't really have a clear idea on when I should use a text file compared to a database or the registry to store info. Also, if I use a database like access 2007 for example, wouldn't an end user run into an exception if they don't have that software installed on their comp? Is there a universal database format? I've linked some screenshots of the prog if you want to get an idea of how much info I need to store.

[URL]

View 3 Replies

Store & Get Connection String From App.config

Mar 11, 2010

I'm stuck regarding to grab connection from app.config file...i'm surf many type and kind to do it..but still can',t.....i need to connect into two database (oracle n firebird).

View 2 Replies

Store Connection String In Registry Key

Nov 12, 2010

I am working on a VB.net winform application which makes extensive us of a mssql database. For the most part (almost exclusively), I have used the Visual Studio dataset for accessing the data. This means that the connection string was created as a program setting, and is saved in the app.config file. The problem that I have, is that I need to move this connection string to the system registry because it has been deemed by the powers that be that a config file is not secure enough.

I think that I can figure out how to access a registry key, and I know that I can save the string to a registry key, but the problem that I am running into is that I don't access the connection key in the code anywhere to easily swap out the registry key for the existing program setting. When VS creates the connection and dataset, where is the connection string referenced? Is there a simple way to swap these out? is it possible even to just reference the registry key in the setting so that I don't have to find where the setting is used and switch it out?

View 2 Replies

WinForms - Where To Store Connection String

Feb 17, 2010

I am working asp.net for a few years. In asp.net, database connection string is stored at web.config file. All page can share this connection string. Now, I need to learn how to create windows app. Where to store a connection string, e.g. connect to SQL, to Access DB, so that all windows forms can share it?

View 5 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

How To Store And Retrieve Connection String From Class

Apr 7, 2011

In my application I have many different forms each use 3 different database. And right now I am placing the connection string in each form but when it is need to change I have to change in every form. Now what I want to store all connection string in a vb class and call them in every form. So that if I need to change I can do in that class. I have stored my connection string in database so even I don't want to connect to database again and again. I have some idea in which maybe a public class is used and some how I will call it on other forms.

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

Encryption - Securely Store Connection String In App.config?

May 15, 2012

I need to know what is the common way to store a SQL server connection string for an application in VB.NET.How do I read app.config values How to do it in ASP How do I store a connectionstring (unencrypted thus unsafe)It's quite frustrating not to find a decent and full answer on how to store a connection string in VB.NET in app.config (or settings.settings if it's better) safely. At the moment it's hardcoded and so it is immobile and in plain text.

View 2 Replies

VB 2008 App - Encrypt Database Connection String In App.Config

Sep 21, 2011

I know this topic has been addressed a million times but please help me out. I have read so many articles on HOW TO encrypt and decrypt the app.config file but I need to know WHEN and WHERE I should encrypt it.

The problem arose because we found an AppName.exe.config file on a users computer and the database username and password was clearly visible. I understand that the .config file gets created during the VB app install process and is used
by the application. I then learned about the aspnet_regiis.exe tool and ran it on the app.config file inside my VB project. I am guessing that was the wrong thing to do.

When I now install the app on user desktops, it gives an error stating failed to decrypt the connection string. Also, when one of my other developers attempts to open the project in his copy of visual studio on his computer, he receives an error when trying to access the setting portion of the project properties. We store all of our projects on a file server and any developer can access the projects via a mapped drive on their computer.

So how am I supposed to encrypt the .config file. If I can't encrypt the App.config file in the development environment, then I'm guessing I have to perform the encryption on the users PC during the install process? How do I do that? Or is that what I am supposed to do?

Just for reference, here is the aspnet_regiis command I ran.

aspnet_regiis.exe -pef "connectionStrings" S:ProjectsDevelopmentVB.netPTPUSourceCodePTPU -prov "DataProtectionConfigurationProvider"

One last thing, maybe it's my misunderstanding of the issue but if this problem has existed since .Net 2.0, why has an option not been built into the development studio to encrypt connection strings?. This would seem to be a very common issue, even their own dataset wizard creates connection strings that are clearly readable.

View 6 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

VS 2005 Can Store Connection String In Web.config File And Access It

Nov 17, 2009

I want to ask that where to store connection string in VB.Net.AS in ASP.net we can store connection string in web.config file and access it in the foll. way [code]In VB.net where to store conn. string on form_Load or any other place???

View 1 Replies

VS 2008 : SQL Local Database Attach (SQL Connection String Error)

Jul 2, 2009

I have attached Database to my vb.net application. Client has sql server 2008 express installed.I built my application and gave to him. he is encountering errors.

PHP
"Data Source=.SQLExpress;Database=xx.mdf;Trusted_Connection=True;Integrated Security=False"

i am getting Cannot Open Database for requested Login. Login Failed. i am using SQL 2008 server Developer edition. And using Windows Authentication mode.

View 9 Replies

Display Connection Properties Dialog For Connection String Browsing(for Database) In Run Time?

Feb 5, 2010

Is there a way to display the connection properties dialog for connection string browsing(for database) in run time?

As I want the user to be able to connect to various database using the GUI.

View 6 Replies

Store The Connection String In The App.config File That Include The Application.startup Path?

Nov 6, 2009

I'm creating window application with VB.NET and flatfiles.the problem is how do i store the connection string in the app.config file that include the application.startup path?

<add name="cn" connectionString="provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "data;Extended Properties=text;" />

i got some error when writing to app.config.

"Missing attribute value on attribute 'Application.StartupPath'."

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 Settings Store A 1-Dimensional Array?

Feb 15, 2010

I'm working on a program that generates random values for a byte array thats length is 16.I have already devised the generation method, but I want to use My.Settings to store this...but I haven't seem to have located Byte() for My.Settings.

View 2 Replies

VS 2008 Store Some Configuration Settings With Time

Mar 20, 2011

I am developing an application, and i need to store some configuration settings, with time, i will need to add some more configuration settings. Am thinking of three alternative to implement that will me easy to access without much coding and efficient sqlite, xml, and application configuration file..But am concerned about security, because some personal data will be saved together.

View 2 Replies

VS 2008 Where To Store Settings For Windows Service

May 13, 2009

I've written a windows service in VB.NET 2.0 and the service needs to know a few file paths and other settings when it starts in order to be able to do what its supposed to do. These are settings that users of my service need to be able to configure themselves so I cant hard code them in.At the moment I just have the service look for a file named Config.INI in the same directory that it is being run from and if this file exists it attempts to read the settings in from there... this works perfectly, but it just feels a bit clunky and old. If it was a normal windows app I would store the settings in an XML file in the user's application data folder or something but as this is a Service then thats not possible as it is not run by any one user (well technically it is, the Local System account). I then thought about using the registry but I seem to recall people saying that you should avoid storing settings in the registry if you can really, especially with the new security in Vista and Server 2008.

View 6 Replies

Store String Data To Mysql Table?

Sep 19, 2009

How to store string data to mysql table.[code]...

View 1 Replies

VS 2008 Store Global Variables, In My.Settings Or My.Namespace?

Dec 4, 2009

Which is the best way to store global variables, in My.Settings or My.Namespace. The reason I ask is because I need to know certain boolean values if certain forms are open from other forms. At present I am defining Global Boolean variables in My.Application, which give the result I require.

View 3 Replies

Extract Data From Html Table And Store Into Access Database?

Mar 20, 2010

I am new here and really excited to see the huge resources on this forum for vb.net. I have just started my learning of vb8 and need to create some basic applications for my personal use.I need to develop an application that can extract data from a html table and store that data into Access database. I have learned to create web browser on Visual Studio 2008. Below is the link from which I need to extract data and store into a database

View 3 Replies

Sql - Copying A Table From One Database Into A Database On A Different Connection (ADO.NET)

Jun 17, 2011

I am trying to copy a table in a database into another database on another connection in VB.NET, using OleDb. If they were on the same connection I would just use SELECT INTO, but they are not. I have two different OleDbConnection and cannot see an easy way to do this.

Right now I am attempting to just copy the database into a DataTable using an OleDbDataAdapter, and then loop through the DataTable and insert every record into the target database one at a time. This obviously takes a ton of time for the large DB I could potentially be dealing with, and I have to deal with escaping strings, null values, etc.

edit - just to make this more clear: I have two OleDbConnection objects, one is linked directly to a local .mdb file on my computer (JET). The other is linked to a database on our servers (SQLOLEDB). I am wanting to do this:

"SELECT * FROM fromDB INTO toDB"

But I can't because fromDB and toDB are on different connections, and the OleDbCommand object is only attached to one. The only way I can see how to do this is to connect to fromDB, copy it into a DataTable, connect to toDB, and copy all of the data in the DataTable row by row into toDB. I was wondering if there is an easier way to do this.

View 3 Replies

Change Table Adapter Connection String ?

Oct 8, 2008

I have a Windows application that uses typed datasets. When setting up the datasets, Visual Studio asks if you want to remember the connection.

Before filling the dataset, I programatically change the connection string of each table adapter so that it will connect to the remote database. Before this operation, it is set to the local database since that is the one I am developing on.[code]...

View 4 Replies

Invalid Connection String When Using Table Adapter?

Jan 17, 2011

I'm trying to use variables in my connection string to a table adapter. The only clean cut method I've seen is the following, however, I'm getting "Invalid Connection string" upon run-time. I'm assuming maybe this can't be done?

Private Sub adaptertest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'BCPM_DDBODataSet.LTC_FBS' table. You can move, or remove it, as needed.
LTC_FBSTableAdapter.Connection.ConnectionString = "Provider=TDOLEDB;Data Source=TDDEV;Persist Security Info=True;User ID={0};Password={1};Default Database=bcpm_ddbo;Session Mode=ANSI;"
Me.LTC_FBSTableAdapter.Fill(Me.BCPM_DDBODataSet.LTC_FBS)

View 2 Replies







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