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 &
dataConfigurati on.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
dataConfigurati on 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 dataConfigurati on file. When the Enterprise Library reads the
dataConfigurati on.config file it passes the following connection string to
SQL Server:
data source=sql123;i nitial catalog=MyDb;pe rsist security info=true;packe t
size=4096
Instead of this one:
data source=SQL123;i nitial catalog=MyDb;pe rsist security info=False;user
id=youruid;;pac ket size=4096; password=yourpw d"
Is following C# code I have missing a step that is causing my issue:
Database db = DatabaseFactory .CreateDatabase ("SQL Server");
string sqlCommand = "autoApInput_ge tFile";
DBCommandWrappe r dbCommandWrappe r =
db.GetStoredPro cCommandWrapper (sqlCommand);
// Add paramters
// Input parameters can specify the input value
dbCommandWrappe r.AddInParamete r("@visitor", DbType.Int32, 1);
dbCommandWrappe r.AddInParamete r("@po", DbType.String, "0018487402 ");
dbCommandWrappe r.AddInParamete r("@poAmount" , DbType.String, "$156.25");
db.ExecuteNonQu ery(dbCommandWr apper);
And the following is the ConnectionStrin g block I have in my
dataConfigurati on.config file:
<connectionStri ng name="SQL Connection String">
<parameters>
<parameter name="data source" value="SQL123" isSensitive="fa lse"/>
<parameter name="initial catalog" value="MyDB"
isSensitive="fa lse" />
<parameter name="persist security info" value="False"
isSensitive="fa lse" />
<parameter name="uid" value="userid" isSensitive="tr ue" />
<parameter name="packet size" value="4096" isSensitive="fa lse" />
<parameter name="pwd" value="password " isSensitive="tr ue" />
</parameters>
</connectionStrin g>
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 &
dataConfigurati on.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
dataConfigurati on 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 dataConfigurati on file. When the Enterprise Library reads the
dataConfigurati on.config file it passes the following connection string to
SQL Server:
data source=sql123;i nitial catalog=MyDb;pe rsist security info=true;packe t
size=4096
Instead of this one:
data source=SQL123;i nitial catalog=MyDb;pe rsist security info=False;user
id=youruid;;pac ket size=4096; password=yourpw d"
Is following C# code I have missing a step that is causing my issue:
Database db = DatabaseFactory .CreateDatabase ("SQL Server");
string sqlCommand = "autoApInput_ge tFile";
DBCommandWrappe r dbCommandWrappe r =
db.GetStoredPro cCommandWrapper (sqlCommand);
// Add paramters
// Input parameters can specify the input value
dbCommandWrappe r.AddInParamete r("@visitor", DbType.Int32, 1);
dbCommandWrappe r.AddInParamete r("@po", DbType.String, "0018487402 ");
dbCommandWrappe r.AddInParamete r("@poAmount" , DbType.String, "$156.25");
db.ExecuteNonQu ery(dbCommandWr apper);
And the following is the ConnectionStrin g block I have in my
dataConfigurati on.config file:
<connectionStri ng name="SQL Connection String">
<parameters>
<parameter name="data source" value="SQL123" isSensitive="fa lse"/>
<parameter name="initial catalog" value="MyDB"
isSensitive="fa lse" />
<parameter name="persist security info" value="False"
isSensitive="fa lse" />
<parameter name="uid" value="userid" isSensitive="tr ue" />
<parameter name="packet size" value="4096" isSensitive="fa lse" />
<parameter name="pwd" value="password " isSensitive="tr ue" />
</parameters>
</connectionStrin g>
Thanks,
Comment