Skip to main content

All Questions

Filter by
Sorted by
Tagged with
9 votes
1 answer
9k views

Secure ConnectionString in WinForm Applications

How Can I Secure my ConnectionString in WinForm Application?
Hossein Moradinia's user avatar
6 votes
3 answers
9k views

Split Connection String

In a WinForm Application I Store My ConnectionString in App.Confing File.How Can I split this connectionstring to some Data like username,DataBaseName,Password and other thing Dynamically?
Hossein Moradinia's user avatar
6 votes
4 answers
5k views

Connection string security in .net desktop application

i'm developing a .net winforms desktop application intended to be run at several bank's branches as a backup application whenever the main one (a web application) is unavailable due to connection ...
Bernabé Panarello's user avatar
5 votes
4 answers
56k views

how to define a connection string using an app.config file in C# [duplicate]

Currently i manually define my connection string in my C# code: string ConnectionString = "Data Source=C;Initial Catalog=tickets;Integrated Security=True"; SqlConnection Conn = new SqlConnection(...
PriceCheaperton's user avatar
4 votes
1 answer
6k views

Iterate through connections strings in App.Config file in VB.Net

I am trying to iterate through all the connection strings in App.Config using VB.net. I would like to: 1. Get a count of all the connection strings 2. Put them all into a listbox. I have tried using ...
Jeremy's user avatar
  • 3,950
4 votes
2 answers
13k views

Connection string for SQL Server ( local database )

I added a local database to my application in Visual Studio: database and I need connection string for it - here it is: SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data ...
Aleksa Djuric's user avatar
4 votes
1 answer
3k views

Location of Microsoft access database for windows form when creating setup file using installshield

I have developed windows form which uses Microsoft Access Database. During development i have put database file in root folder with in project. When i run application through visual studio, it run ...
Amrit Sharma's user avatar
  • 1,906
3 votes
3 answers
3k views

Protecting connection string from Man in the middle

In my winforms application i am hashing the connection string in local level. But here a couple of questions. After my app decrypts the connection string, the connection string info is sent in ...
OrElse's user avatar
  • 9,879
3 votes
2 answers
12k views

How to create connection string dynamically in C# [closed]

How to create connection string dynamically in C#, instead of creating it using string concatenation?
rgy's user avatar
  • 66
3 votes
2 answers
744 views

C# WinForm set ConnectionString and Entity Framework on installation

I use clickonce to deploy my program. the problem is the deployement team have to enter his conectionString on installation and write into app.config. How can I add a dialogbox (for put the ...
user609511's user avatar
  • 4,171
3 votes
6 answers
22k views

Getting error: A network-related or instance-specific error occurred while establishing a connection to SQL Server

I'm newbie developer. I have a problem trying to connect to SQL Server from my computer to server machine. A network-related or instance-specific error occurred while establishing a connection to ...
Ich-Bullet Puen's user avatar
3 votes
2 answers
2k views

C# ConfigurationManager retrieves wrong connection string from app.config

I have a simple WinForms app that will eventually be a game. Right now, I'm just working on the data access layer of it and I've run into a snag. I created a separate project called DataAccess and ...
Kyle Rone's user avatar
  • 305
3 votes
1 answer
20k views

Winforms connection strings from App.config

I have a Winforms app that I am developing in C# that will serve as a frontend for a SQL Server 2005 database. I rolled the executable out to a test machine and ran it. It worked perfectly fine on the ...
Geo Ego's user avatar
  • 1,325
3 votes
1 answer
2k views

Build SQL Connection string with integrated security for use over VPN?

I have Winforms application that connects to a SQL database. We are changing the connection strings so that they will now use integrated security (Windows Authentication) instead of SQL authentication....
Cuthbert's user avatar
  • 2,978
3 votes
1 answer
3k views

Connection string not being read from App.config in project

I am using an abstract class to get the ConnectionString from my App.config file. However instead of the ConnectionString specified the app comes up with ... {data source=.\SQLEXPRESS;Integrated ...
webworm's user avatar
  • 10.9k
2 votes
3 answers
334 views

Unable to connect to Local SQL database from app.config in windows form application

i am trying to connect my local MySQL database to my windows form application using app.config. but i am keep on getting the below mentioned Exception.Can anyone help me please. Exception : App....
ramki_ramakrishnan's user avatar
2 votes
1 answer
2k views

Quick Book Integration with C# Windows Application

I have Quick book application installed in my system. And i have created few vendors and customers list. Quick Book: QuickBooks Simple Start 2010 Free Edition Database : QuickBooks Database Server ...
RajeshKdev's user avatar
  • 6,445
2 votes
3 answers
2k views

Winforms - Replace a ConnectionString at runtime

I'd like to allow my users to switch between different databases on the login page at runtime. I currently have the ConnectionString stored in my App Settings file and all the datasets refer to this ...
Nathan Koop's user avatar
  • 25.1k
2 votes
2 answers
3k views

Read configuration from App.config instead of AppName.exe.config

I have developed a small windows service which performs few database operations. I have to give an option to the user to change server name on post-deploy. if user changes in app.config it doesn't ...
Ravi Kumar G N's user avatar
2 votes
1 answer
1k views

Advice in storing sensitive data in Windows Form Application vb.net c#

I'm currently working on a Windows Application Project and I have two problems in securing data. First,I need to make a file that store a password as string which the user should enter it every time ...
BJ Davey's user avatar
2 votes
1 answer
3k views

Open SQLITE read-only in c#

I trying to open an SQLITE database in read-only mode according this link:Connection strings for SQLite SQLITE Connection string string ConString = string.Format(@"Data Source={0}dbname.s3db;...
KF2's user avatar
  • 10.1k
2 votes
2 answers
957 views

C# WinForms changing database name in other form

So here is my first question and my first C# program: I need function that could permanently change a connection string. My program has this structure: Main form is Form1, when I click the button, ...
vul6's user avatar
  • 451
2 votes
3 answers
20k views

App.Config Connection String

In my windows form i have connection string in app.config as <configuration> <configSections> </configSections> <connectionStrings> <add name="Database"...
Amrit Sharma's user avatar
  • 1,906
1 vote
1 answer
322 views

Where does app.config belong?

i have a winforms app, the solution has two projects client (winforms) and the business logic(as Library classes). When i create a datset.xsd file in the client, it adds app.config file to the client. ...
Phill Greggan's user avatar
1 vote
4 answers
1k views

ConnectionString for connecting to SQL Server Database?

I have an application (WinForms) which using SQL Server as its database. Now I am using app.config file to access ConnectionString. Have a look at my app.config file <configuration> <...
Aryan SuryaWansi's user avatar
1 vote
5 answers
899 views

Best way to set up the connection setting

I am new to windows forms programming and I was wondering what would be the best way to create like a connectionstring.config (i dont know how to do this) I have seens it , its like an xml giving all ...
user710502's user avatar
  • 11.4k
1 vote
1 answer
1k views

How to store MySql database connection string in C# WinFrom desktop application

Keeping of MySql connection string with server, user, password and database data seems incorrect inside the code. I see only two ways, how it can be stored, one is adding into Resources .txt like ...
lf80's user avatar
  • 495
1 vote
1 answer
344 views

Understanding the different ways to connect to CRM 2011

I'm a beginner CRM developer and I'm quite confused about the connection methods to CRM. What's the difference between creating a SOAP service reference to connect to CRM 2011 from a windows form ...
user3340627's user avatar
  • 3,113
1 vote
1 answer
1k views

How to get the DataSource name in dropdownlist control in C# Winforms

Hi I am developing an application to retrieve data from one system to another remote system. To do this I am firstly setting the connection string of the application by below screen. When I chose the ...
Ashok's user avatar
  • 1,908
1 vote
3 answers
2k views

cannot connect sql server 2008 from another computer [duplicate]

Possible Duplicate: System.Data.SqlClient.SqlException A network-related or instance-specific error i have winform application in c# which connect to my own db and its working fine my current sql ...
Drone's user avatar
  • 181
1 vote
1 answer
2k views

How to correctly move location of .mdf file and change Connection String's DataDirectory accordingly

Currently my SQL database is on C:\Users\Slaven\KasaMP.mdf I want to move it into my projects directory [maybe "database" folder(?)] and make correct changes on my connectionstring. My goal is to ...
solujic's user avatar
  • 1,004
1 vote
3 answers
4k views

C# WinForm application - How to save connection string (SQLite)

I have a winform app in .NET 4.0 with database (SQLite). I need to add an option for user to be able to change the path to the file containing the database - in short, to change the connection string. ...
user1080533's user avatar
1 vote
2 answers
3k views

Reading a connection string from a class library

I am currently struggling to read a connection string from the App.config inside my WinForms application from my Class Library (and Unit Testing). I added a 'test' entry to the App.config; <...
Roel's user avatar
  • 754
1 vote
2 answers
592 views

Delete the old connectionstring

I have created a application that can create connectionstrings and edit connectionstrings. doc.Load(Path.Combine(path, SelectConfigComboBox.SelectedItem.ToString(), "app.config")); XmlNode xNode = ...
user avatar
1 vote
2 answers
862 views

How to Change Connection String of Published Application

I have published a windows form application with a certain sql connection string . for security reasons i should change the password of my sql server user wich is used in connection string. I tried to ...
Behnam's user avatar
  • 1,045
1 vote
2 answers
291 views

ArgumentException caught while trying to enter connection string

I am trying to develop a very simple Student Enrollment System, and as I built and compiled my solution, an ArgumentException was caught near my connection string. The exception message displayed is ...
Choudhury Saadmaan Mahmid's user avatar
1 vote
1 answer
1k views

How to change App.config file at run time from textbox value?

I have created a project which has App.config file. This App.config file is fixed. I wanna change connectionString at run time using textbox's value. Here are two textboxes textbox1 & textbox2. ...
Arif's user avatar
  • 29
1 vote
1 answer
429 views

Installation project dynamic connection string

I have a windows forms application, that i want to deploy as installation project using visual studio 2010. I am using SQLite database and i want to create a connection string while the installation ...
Concware's user avatar
  • 277
1 vote
1 answer
134 views

Specify SQL Server connectionstring on a messed up network

The current scenario before i start asking my question A C# Winforms application needs to be deployed on our LAN. The network contains 200+ computers running Windows XP (& above) having the same ...
Question Guy's user avatar
1 vote
1 answer
995 views

vb.net connection entity framework connection string security

I understand the possibilities for encrypting a connection string in .net v4. I have a win forms application that will be used by multiple people on different machines. I understand that I need to ...
WizardsSleeve's user avatar
1 vote
1 answer
2k views

Save a new connection string from within a windows forms app?

I'm writing a Windows Forms app, VS2010, NET Framework 4.0, coding in VB. I'm using the Microsoft Data Connection Configuration dialog in my app to choose a data source. It seems to work fine and ...
Dave Becker's user avatar
1 vote
1 answer
121 views

Is it okay to have plaintext database username and password inside Dataset.xsd file in a C# winform application?

I have a dataset.xsd file within a C# winform application. when I opened the datased.xsd file with notepad++ I found all the database authentication information (id, password). I read about ...
enLighter Programmer's user avatar
1 vote
0 answers
176 views

Different behaviors in similar SQL Server connection string using C#

I have encountered a situation which looks weird to me. Though I have figured out another simpler way for my code to work but I'm curious to know as why this is happening. Here is the code that works ...
Ravi Gaurav Pandey's user avatar
1 vote
1 answer
440 views

How can i tell if my connectionStrings section is encrypted or not?

I have followed Microsoft's instructions here in order to encrypt my connection strings for my application. I have opted to move my connection strings to their own configuration file, connections....
Rhurac's user avatar
  • 449
1 vote
3 answers
585 views

Why doesn't DataDirectory change on run time

I am tring to connect to a local database with w winform c# application when i set my connection string to Data: Source=C:\Users\PACKARD BELL\documents\visual studio 2010\Projects\GestionStock\MyApp\...
user3336078's user avatar
1 vote
2 answers
682 views

ConfigurationManager.ConnectionString reads app.config from different location

The app.config of my C# windows application has the following ConnectionString <connectionStrings> <add name="DS1" connectionString="Data Source=DataSource1;" providerName="" /> &...
Vikas Kunte's user avatar
1 vote
0 answers
60 views

DataDirectory macro works for SQL Server CE 3.5, but not 4.0

In attempting to upgrade a WinForms application using SQL CE 3.5 to 4.0, I found that the DataDirectory macro was not getting replaced. SqlCeConnection.DataSource always shows "|DataDirectory|" ...
Lee Gray's user avatar
1 vote
1 answer
3k views

How do I format the Db connectionstring in my app.config file for a Windows Forms Application?

I've scoured the internet to try and configure my App.config connectionstring properly for a Windows Forms application to no avail. Here's my first attempt at connecting my application to my database:...
El Duderino's user avatar
1 vote
1 answer
2k views

App Config - The Login is from an untrusted domain

First, I try to connect to sql server of other computer(PC1-PC\Instance1) through ssms with Windows Authentication but got this error Login failed. The login is from an untrusted domain and cannot ...
Karlx Swanovski's user avatar
1 vote
0 answers
596 views

Ms Access connection string

I am making a single user database app. I have created a database in Ms Access. Here is the code I have written... OleDbConnection con; con = new OleDbConnection(@"Provider=Microsoft.ACE....
user2550604's user avatar