G
Guest
Hello,
I am working with Framework 1.1 and Microsoft Enterprise Library 2005. I've
used the Enterprise Library Configuration utility to create my app.config &
dataConfiguration.config files.
My question is, why is the Enterprise Library stripping out my User Id and
Password from my SQL Server connection string, that I have in the
dataConfiguration file? This is an internal app that has no UI and is an
automated process that runs Store procedures which is why I have the UID and
PWD in my dataConfiguration file. When the Enterprise Library reads the
dataConfiguration.config file it passes the following connection string to
SQL Server:
data source=sql123;initial catalog=MyDb;persist security info=true;packet
size=4096
Instead of this one:
data source=SQL123;initial catalog=MyDb;persist security info=False;user
id=youruid;;packet size=4096; password=yourpwd"
Is following C# code I have missing a step that is causing my issue:
Database db = DatabaseFactory.CreateDatabase("SQL Server");
string sqlCommand = "autoApInput_getFile";
DBCommandWrapper dbCommandWrapper =
db.GetStoredProcCommandWrapper(sqlCommand);
// Add paramters
// Input parameters can specify the input value
dbCommandWrapper.AddInParameter("@visitor", DbType.Int32, 1);
dbCommandWrapper.AddInParameter("@po", DbType.String, "0018487402");
dbCommandWrapper.AddInParameter("@poAmount", DbType.String, "$156.25");
db.ExecuteNonQuery(dbCommandWrapper);
And the following is the ConnectionString block I have in my
dataConfiguration.config file:
<connectionString name="SQL Connection String">
<parameters>
<parameter name="data source" value="SQL123" isSensitive="false"/>
<parameter name="initial catalog" value="MyDB"
isSensitive="false" />
<parameter name="persist security info" value="False"
isSensitive="false" />
<parameter name="uid" value="userid" isSensitive="true" />
<parameter name="packet size" value="4096" isSensitive="false" />
<parameter name="pwd" value="password" isSensitive="true" />
</parameters>
</connectionString>
Thanks,
I am working with Framework 1.1 and Microsoft Enterprise Library 2005. I've
used the Enterprise Library Configuration utility to create my app.config &
dataConfiguration.config files.
My question is, why is the Enterprise Library stripping out my User Id and
Password from my SQL Server connection string, that I have in the
dataConfiguration file? This is an internal app that has no UI and is an
automated process that runs Store procedures which is why I have the UID and
PWD in my dataConfiguration file. When the Enterprise Library reads the
dataConfiguration.config file it passes the following connection string to
SQL Server:
data source=sql123;initial catalog=MyDb;persist security info=true;packet
size=4096
Instead of this one:
data source=SQL123;initial catalog=MyDb;persist security info=False;user
id=youruid;;packet size=4096; password=yourpwd"
Is following C# code I have missing a step that is causing my issue:
Database db = DatabaseFactory.CreateDatabase("SQL Server");
string sqlCommand = "autoApInput_getFile";
DBCommandWrapper dbCommandWrapper =
db.GetStoredProcCommandWrapper(sqlCommand);
// Add paramters
// Input parameters can specify the input value
dbCommandWrapper.AddInParameter("@visitor", DbType.Int32, 1);
dbCommandWrapper.AddInParameter("@po", DbType.String, "0018487402");
dbCommandWrapper.AddInParameter("@poAmount", DbType.String, "$156.25");
db.ExecuteNonQuery(dbCommandWrapper);
And the following is the ConnectionString block I have in my
dataConfiguration.config file:
<connectionString name="SQL Connection String">
<parameters>
<parameter name="data source" value="SQL123" isSensitive="false"/>
<parameter name="initial catalog" value="MyDB"
isSensitive="false" />
<parameter name="persist security info" value="False"
isSensitive="false" />
<parameter name="uid" value="userid" isSensitive="true" />
<parameter name="packet size" value="4096" isSensitive="false" />
<parameter name="pwd" value="password" isSensitive="true" />
</parameters>
</connectionString>
Thanks,