Exception: The ConnectionString property has not been initialized

Exception: The ConnectionString property has not been initialized

am 03.04.2008 21:15:00 von JustinDoh

Hello.
I had this error for a long time, and I need some help.

My program is a very simple System.Web.Mail program that calls a stored
procedure “spSendEmailNotification” and get data.
And based on the value that I get from the stored procedure, Web Mail is
sent of not.

Basically, I get this error when I execute an EXE file using Command Prompt:
“Exception: The ConnectionString property has not been initialized”

My first approach was looking at the Web.Config file.




/>

Or should I use this?? I am not sure what to add for the Password.. I just
guessed.




After getting the error, I added the following lines inside
at the Web.Config file inside hoping that it would resolve
the error.


connectionString="Data Source=SQL1;Integrated Security=SSPI;Initial
Catalog=Prod;"
providerName="System.Data.SqlClient" />




This is what is written at the business layer.

Public Function getEmailNotify() As DataSet
Return obj.GetData("spSendEmailNotification",
System.Configuration.ConfigurationSettings.AppSettings.Get(" Prod"))
End Function


I would appreciate if anyone gives me some feedback.

Thanks in advance.

Re: Exception: The ConnectionString property has not been initialized

am 03.04.2008 22:08:03 von Norman Yuan

Simply do a debugging to see if the ConnectionString is actually loaded from
web.config or not:

Public Function getEmailNotify() As DataSet

''Place breakpoint HERE, to see what value "cn" gets, so you know the
setting is read in correctly ornot.
Dim cn As
String=System.Configuration.ConfigurationSettings.AppSetting s.Get("Prod")

Return obj.GetData("spSendEmailNotification", cn)

End Function



"Justin Doh" wrote in message
news:E0FDFBA3-F3B2-4441-9701-AFDBA8D494AF@microsoft.com...
> Hello.
> I had this error for a long time, and I need some help.
>
> My program is a very simple System.Web.Mail program that calls a stored
> procedure “spSendEmailNotification” and get data.
> And based on the value that I get from the stored procedure, Web Mail is
> sent of not.
>
> Basically, I get this error when I execute an EXE file using Command
> Prompt:
> “Exception: The ConnectionString property has not been initialized”
>
> My first approach was looking at the Web.Config file.
>
>
>
>
> > />
>
> Or should I use this?? I am not sure what to add for the Password.. I just
> guessed.
>
>
>
>
> After getting the error, I added the following lines inside
>
> at the Web.Config file inside hoping that it would resolve
> the error.
>
>
> > connectionString="Data Source=SQL1;Integrated
> Security=SSPI;Initial
> Catalog=Prod;"
> providerName="System.Data.SqlClient" />
>

>
>
>
> This is what is written at the business layer.
>
> Public Function getEmailNotify() As DataSet
> Return obj.GetData("spSendEmailNotification",
> System.Configuration.ConfigurationSettings.AppSettings.Get(" Prod"))
> End Function
>
>
> I would appreciate if anyone gives me some feedback.
>
> Thanks in advance.
>
>

Re: Exception: The ConnectionString property has not been initiali

am 03.04.2008 23:26:01 von JustinDoh

Actually, I am not sure whether it is still causing an error or not.

This is what is showing after debug.
At the end, it indicates "..has existed with code 0 (0x0)", but it still
shows the message "Exception: The ConnectionString property has not been
initialized" at the command prompt.
------------------------------------------------------------ ----------------------
'DefaultDomain': Loaded
'c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded.
'RootCause2': Loaded 'P:\My Documents\Work-others\Other
Misc\bin\RootCause2.exe', No symbols loaded.
'RootCause2.exe': Loaded
'c:\winnt\assembly\gac\microsoft.visualbasic\7.0.5000.0__b03 f5f7f11d50a3a\microsoft.visualbasic.dll', No symbols loaded.
'RootCause2.exe': Loaded
'c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a 3a\system.web.dll', No symbols loaded.
'RootCause2.exe': Loaded
'c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\s ystem.dll', No
symbols loaded.
'RootCause2.exe': Loaded
'c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e 089\system.data.dll', No symbols loaded.
'RootCause2.exe': Loaded
'c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e0 89\system.xml.dll', No symbols loaded.
'RootCause2.exe': Loaded 'p:\my documents\work-others\other
misc\bin\libdata.dll', No symbols loaded.
The program '[1356] RootCause2.exe' has exited with code 0 (0x0).

I am not sure what is going on.
Any feedback is appreciated.

Thanks in advance.
Justin


"Norman Yuan" wrote:

> Simply do a debugging to see if the ConnectionString is actually loaded from
> web.config or not:
>
> Public Function getEmailNotify() As DataSet
>
> ''Place breakpoint HERE, to see what value "cn" gets, so you know the
> setting is read in correctly ornot.
> Dim cn As
> String=System.Configuration.ConfigurationSettings.AppSetting s.Get("Prod")
>
> Return obj.GetData("spSendEmailNotification", cn)
>
> End Function
>
>
>
> "Justin Doh" wrote in message
> news:E0FDFBA3-F3B2-4441-9701-AFDBA8D494AF@microsoft.com...
> > Hello.
> > I had this error for a long time, and I need some help.
> >
> > My program is a very simple System.Web.Mail program that calls a stored
> > procedure “spSendEmailNotification” and get data.
> > And based on the value that I get from the stored procedure, Web Mail is
> > sent of not.
> >
> > Basically, I get this error when I execute an EXE file using Command
> > Prompt:
> > “Exception: The ConnectionString property has not been initialized”
> >
> > My first approach was looking at the Web.Config file.
> >
> >
> >
> >
> > > > />
> >
> > Or should I use this?? I am not sure what to add for the Password.. I just
> > guessed.
> >
> >
> >
> >
> > After getting the error, I added the following lines inside
> >
> > at the Web.Config file inside hoping that it would resolve
> > the error.
> >
> >
> > > > connectionString="Data Source=SQL1;Integrated
> > Security=SSPI;Initial
> > Catalog=Prod;"
> > providerName="System.Data.SqlClient" />
> >

> >
> >
> >
> > This is what is written at the business layer.
> >
> > Public Function getEmailNotify() As DataSet
> > Return obj.GetData("spSendEmailNotification",
> > System.Configuration.ConfigurationSettings.AppSettings.Get(" Prod"))
> > End Function
> >
> >
> > I would appreciate if anyone gives me some feedback.
> >
> > Thanks in advance.
> >
> >
>
>

Re: Exception: The ConnectionString property has not been initiali

am 04.04.2008 00:02:28 von JustinDoh

I did not debug as "debug" mode but as "Release" mode last time.

But even when I debugged as "debug" mode, it did have any value for the cn.

What might be an issue?
I would appreciate for any feedback.

Thanks.

"Justin Doh" wrote:

> Actually, I am not sure whether it is still causing an error or not.
>
> This is what is showing after debug.
> At the end, it indicates "..has existed with code 0 (0x0)", but it still
> shows the message "Exception: The ConnectionString property has not been
> initialized" at the command prompt.
> ------------------------------------------------------------ ----------------------
> 'DefaultDomain': Loaded
> 'c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded.
> 'RootCause2': Loaded 'P:\My Documents\Work-others\Other
> Misc\bin\RootCause2.exe', No symbols loaded.
> 'RootCause2.exe': Loaded
> 'c:\winnt\assembly\gac\microsoft.visualbasic\7.0.5000.0__b03 f5f7f11d50a3a\microsoft.visualbasic.dll', No symbols loaded.
> 'RootCause2.exe': Loaded
> 'c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a 3a\system.web.dll', No symbols loaded.
> 'RootCause2.exe': Loaded
> 'c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\s ystem.dll', No
> symbols loaded.
> 'RootCause2.exe': Loaded
> 'c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e 089\system.data.dll', No symbols loaded.
> 'RootCause2.exe': Loaded
> 'c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e0 89\system.xml.dll', No symbols loaded.
> 'RootCause2.exe': Loaded 'p:\my documents\work-others\other
> misc\bin\libdata.dll', No symbols loaded.
> The program '[1356] RootCause2.exe' has exited with code 0 (0x0).
>
> I am not sure what is going on.
> Any feedback is appreciated.
>
> Thanks in advance.
> Justin
>
>
> "Norman Yuan" wrote:
>
> > Simply do a debugging to see if the ConnectionString is actually loaded from
> > web.config or not:
> >
> > Public Function getEmailNotify() As DataSet
> >
> > ''Place breakpoint HERE, to see what value "cn" gets, so you know the
> > setting is read in correctly ornot.
> > Dim cn As
> > String=System.Configuration.ConfigurationSettings.AppSetting s.Get("Prod")
> >
> > Return obj.GetData("spSendEmailNotification", cn)
> >
> > End Function
> >
> >
> >
> > "Justin Doh" wrote in message
> > news:E0FDFBA3-F3B2-4441-9701-AFDBA8D494AF@microsoft.com...
> > > Hello.
> > > I had this error for a long time, and I need some help.
> > >
> > > My program is a very simple System.Web.Mail program that calls a stored
> > > procedure “spSendEmailNotification” and get data.
> > > And based on the value that I get from the stored procedure, Web Mail is
> > > sent of not.
> > >
> > > Basically, I get this error when I execute an EXE file using Command
> > > Prompt:
> > > “Exception: The ConnectionString property has not been initialized”
> > >
> > > My first approach was looking at the Web.Config file.
> > >
> > >
> > >
> > >
> > > > > > />
> > >
> > > Or should I use this?? I am not sure what to add for the Password.. I just
> > > guessed.
> > >
> > >
> > >
> > >
> > > After getting the error, I added the following lines inside
> > >
> > > at the Web.Config file inside hoping that it would resolve
> > > the error.
> > >
> > >
> > > > > > connectionString="Data Source=SQL1;Integrated
> > > Security=SSPI;Initial
> > > Catalog=Prod;"
> > > providerName="System.Data.SqlClient" />
> > >

> > >
> > >
> > >
> > > This is what is written at the business layer.
> > >
> > > Public Function getEmailNotify() As DataSet
> > > Return obj.GetData("spSendEmailNotification",
> > > System.Configuration.ConfigurationSettings.AppSettings.Get(" Prod"))
> > > End Function
> > >
> > >
> > > I would appreciate if anyone gives me some feedback.
> > >
> > > Thanks in advance.
> > >
> > >
> >
> >