473,396 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

problem with app.exe.config

Hello,
I am developing a vb.net application using a mySql database with
corelabs provider.
I am having a bit of difficulty getting a db connection to work. Here
is my app.exe.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appsettings>
<add key = "ConnectionString" value =
"Database=genesys;userid=daniel;password=*******;h ost=192.168.1.4;" />
</appsettings>
And here is the code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim myCon As MySqlConnection
Dim myCmd As MySqlCommand
Dim strSql As String = ("Select * from pt_info")

myCon = New MySqlConnection
myCon.ConnectionString =
(System.Configuration.ConfigurationSettings.AppSet tings("ConnectionString"))
myCon.Open() <--error here
myCmd = New MySqlCommand(strSql, myCon)
Dim myReader As MySqlDataReader
myReader = myCmd.ExecuteReader()
If myReader.Read Then
Label1.Text = ("Successfull, baby")
End If
End Sub

For some reason, I am getting an ConnectionString property not
initialized error when the form loads. I can't figure out why
Can someone please help???

TIA,

Daniel
Nov 21 '05 #1
4 1605
> "Database=genesys;userid=daniel;password=*******;h ost=192.168.1.4;" />
myCon.ConnectionString =
(System.Configuration.ConfigurationSettings.AppSet tings("ConnectionString"))
myCon.Open() <--error here


A few things to try...

change "userid" to "uid"
change "password" to "pwd"
change "host" to "server"
get rid of the trailing ";"

See if that makes a difference.

If that doesn't help, try this...

myCon.ConnectionString
="Database=genesys;userid=daniel;password=*******; host=192.168.1.4"

and see what happens...

here's a sample of what I use...
<appSettings>

<add key="TSG_CS"
value="server=mtgenwks0024;database=TSG_CS;UID=den 1tro;PWD=*"/>

<add key="netop_phbook"
value="server=mtgenwks0024;database=netop_phbook;u id=den1tro;pwd=*"/>

</appSettings>
Nov 21 '05 #2
Thanks for the response. I will give those ideas a try! But, right
now, it is Friday night, and I must go have fun.
Will let you know Monday.
Thanks Again!

Daniel

On Fri, 9 Sep 2005 18:44:00 -0600, "Terry Olsen"
<to******@hotmail.com> wrote:
"Database=genesys;userid=daniel;password=*******;h ost=192.168.1.4;" />
myCon.ConnectionString =
(System.Configuration.ConfigurationSettings.AppSet tings("ConnectionString"))
myCon.Open() <--error here


A few things to try...

change "userid" to "uid"
change "password" to "pwd"
change "host" to "server"
get rid of the trailing ";"

See if that makes a difference.

If that doesn't help, try this...

myCon.ConnectionString
="Database=genesys;userid=daniel;password=******* ;host=192.168.1.4"

and see what happens...

here's a sample of what I use...
<appSettings>

<add key="TSG_CS"
value="server=mtgenwks0024;database=TSG_CS;UID=de n1tro;PWD=*"/>

<add key="netop_phbook"
value="server=mtgenwks0024;database=netop_phbook; uid=den1tro;pwd=*"/>

</appSettings>


Nov 21 '05 #3
> "Database=genesys;userid=daniel;password=*******;h ost=192.168.1.4;" />
myCon.ConnectionString =
(System.Configuration.ConfigurationSettings.AppSet tings("ConnectionString"))
myCon.Open() <--error here


A few things to try...

change "userid" to "uid"
change "password" to "pwd"
change "host" to "server"
get rid of the trailing ";"

See if that makes a difference.

If that doesn't help, try this...

myCon.ConnectionString
="Database=genesys;userid=daniel;password=*******; host=192.168.1.4"

and see what happens...

here's a sample of what I use...
<appSettings>

<add key="TSG_CS"
value="server=mtgenwks0024;database=TSG_CS;UID=den 1tro;PWD=*"/>

<add key="netop_phbook"
value="server=mtgenwks0024;database=netop_phbook;u id=den1tro;pwd=*"/>

</appSettings>
Nov 21 '05 #4
Thanks for the response. I will give those ideas a try! But, right
now, it is Friday night, and I must go have fun.
Will let you know Monday.
Thanks Again!

Daniel

On Fri, 9 Sep 2005 18:44:00 -0600, "Terry Olsen"
<to******@hotmail.com> wrote:
"Database=genesys;userid=daniel;password=*******;h ost=192.168.1.4;" />
myCon.ConnectionString =
(System.Configuration.ConfigurationSettings.AppSet tings("ConnectionString"))
myCon.Open() <--error here


A few things to try...

change "userid" to "uid"
change "password" to "pwd"
change "host" to "server"
get rid of the trailing ";"

See if that makes a difference.

If that doesn't help, try this...

myCon.ConnectionString
="Database=genesys;userid=daniel;password=******* ;host=192.168.1.4"

and see what happens...

here's a sample of what I use...
<appSettings>

<add key="TSG_CS"
value="server=mtgenwks0024;database=TSG_CS;UID=de n1tro;PWD=*"/>

<add key="netop_phbook"
value="server=mtgenwks0024;database=netop_phbook; uid=den1tro;pwd=*"/>

</appSettings>


Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dan Perl | last post by:
Here is a problem I am having trouble with and I hope someone in this group will suggest a solution. First, some code that works. 3 classes that are derived from each other (A->B->C), each one...
1
by: timothy.williams | last post by:
I'm trying to install wxPython 2.5.3.1 using Python 2.3.2 on a Fedora 2 machine. I have python in a non-standard place, but I'm using --prefix with the configure script to point to where I have...
13
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a...
2
by: Eric Caron | last post by:
Hi Here's my problem, I create a windows service with Config.xml file. All setup for my service is in this file. I create a windows application to manage these settings (Config.XML File). This...
0
by: Johannes H?drich | last post by:
Hello folks, i've got a tough problem with configuration the CMAB in my asp.net application. Following scenario is given: root directory (ASP.NET Application) |- web.config (access from CMAB...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
10
by: Antoon Pardon | last post by:
I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , ) def foo(): config = Cfg()
2
by: Ian | last post by:
Hi, I am trying to use machine.config to store database settings for a connection wrapper class I am using as part of the data layer of an n-tier system. Have added the following section to...
3
by: Alok yadav | last post by:
I have an open IP and on that IP our main application is hosted. it uses ajax. in web.config file i have register ajax handlers. there are also other sites or project on that IP. now my problem is...
5
by: =?Utf-8?B?VGhlIE1hbiBGcm9tIFNRTA==?= | last post by:
I'm having the darndest XML config file problem that I really need help with. I'm supporting a .NET 1.1 desktop application with its own config file, and I implement IConfigurationSectionHandler...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.