J
Justin Doh
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.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Prod" value="server=SQL1;database=Prod;Integrated Security=SSPI"
/>
Or should I use this?? I am not sure what to add for the Password.. I just
guessed.
<add key="Prod" value="User ID=prod_group;Password=prod^group;data
source=SQL1;persist security info=True;initial catalog=Prod" />
After getting the error, I added the following lines inside <configuration>
at the Web.Config file inside <configuration> hoping that it would resolve
the error.
<connectionStrings>
<add name="Prod"
connectionString="Data Source=SQL1;Integrated Security=SSPI;Initial
Catalog=Prod;"
providerName="System.Data.SqlClient" />
</connectionStrings>
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.
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.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Prod" value="server=SQL1;database=Prod;Integrated Security=SSPI"
/>
Or should I use this?? I am not sure what to add for the Password.. I just
guessed.
<add key="Prod" value="User ID=prod_group;Password=prod^group;data
source=SQL1;persist security info=True;initial catalog=Prod" />
After getting the error, I added the following lines inside <configuration>
at the Web.Config file inside <configuration> hoping that it would resolve
the error.
<connectionStrings>
<add name="Prod"
connectionString="Data Source=SQL1;Integrated Security=SSPI;Initial
Catalog=Prod;"
providerName="System.Data.SqlClient" />
</connectionStrings>
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.