PC Review


Reply
Thread Tools Rate Thread

Deploy Connect String Error

 
 
=?Utf-8?B?TWlrZSBM?=
Guest
Posts: n/a
 
      28th Sep 2005
This is for a Win form.

I created a "Setup and Deployment Project", added my exe and app.config file
to the "Application Folder". I then built the solution.

I ran the setup file on my computer with no errors. When I try to run the
exe that the setup program created I get an error, "The ConnectionString
property has not been initialized."

 
Reply With Quote
 
 
 
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      29th Sep 2005
Hi Cadel,

From the error message, this is not an installation issue. It seems that a
connection's ConnectionString property was not set properly. When the
connection string is empty, this error was generated. Please check your
code to see if any ConnectionString property was not set.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
=?Utf-8?B?TWlrZSBM?=
Guest
Posts: n/a
 
      29th Sep 2005
The application works in design time, and I can run the exe in the bin folder.
C:\Documents and Settings\mikel.ODWC\My Documents\Visual Studio
Projects\LicenseDealerSales\bin\Debug\LicenseDealerSales.exe

But I can't run the exe in the folder the setup creates.
C:\Program Files\Default Company Name\LicenseDealerSales
Setup\LicenseDealerSales.exe

I get "The ConnectionString property has not been initialized." error message.


"Kevin Yu [MSFT]" wrote:

> Hi Cadel,
>
> From the error message, this is not an installation issue. It seems that a
> connection's ConnectionString property was not set properly. When the
> connection string is empty, this error was generated. Please check your
> code to see if any ConnectionString property was not set.
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>

 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      30th Sep 2005
Hi Cadel,

Please check in your app that where does the ConnectionString come from? Is
it hard coded in the app or loaded from a .config file?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
=?Utf-8?B?TWlrZSBM?=
Guest
Posts: n/a
 
      3rd Oct 2005
I have the connection string in App.config.

Here is the code, I removed the password for security.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<appSettings>

<add key="dsn" value="Data Source=db;Database=License;Integrated
Security=False;User ID=de;password=REMOVED" />


</appSettings>

</configuration>



"Kevin Yu [MSFT]" wrote:

> Hi Cadel,
>
> Please check in your app that where does the ConnectionString come from? Is
> it hard coded in the app or loaded from a .config file?
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>

 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      4th Oct 2005
Hi Cadel,

From the error mesage, there must be a connection whose connection string
was not set. When opening, the exception is throw. In this case I suggest
you write some code to print out all the connection strings before opening
a connection. This may help you to find which connection string was not
initialized. When you see an empty connection string, it is the problem.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
=?Utf-8?B?TWlrZSBM?=
Guest
Posts: n/a
 
      4th Oct 2005
Much easier to use MessageBox.Show then to print connection string.

I figured it out, it was a security issue with .net. I ran caspol.exe and
it fixed it.

"Kevin Yu [MSFT]" wrote:

> Hi Cadel,
>
> From the error mesage, there must be a connection whose connection string
> was not set. When opening, the exception is throw. In this case I suggest
> you write some code to print out all the connection strings before opening
> a connection. This may help you to find which connection string was not
> initialized. When you see an empty connection string, it is the problem.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>

 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      6th Oct 2005
Nice to hear that you have had the problem resolved.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Quick Deploy and Connect" - what am I doing wrong? becface@gmail.com Windows XP Work Remotely 0 31st Jul 2006 09:22 PM
ADO connect not using UID in connect string =?Utf-8?B?Um9iZXJ0?= Microsoft Access VBA Modules 2 21st Feb 2005 01:15 PM
Shared Sub Connect(server As [String], message As [String]) ? Emilio Microsoft VB .NET 4 6th Oct 2004 11:36 AM
Re: Connect string Ken Tucker [MVP] Microsoft VB .NET 0 14th Jul 2004 02:13 AM
Deploy to Windows Server 2003 & connect to Oracle database =?Utf-8?B?bWc=?= Microsoft ADO .NET 0 18th Jun 2004 08:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:27 PM.