473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

User Id & Password problems

SAL
Hello,

Currently, I'm using Visual Studio 2003, C#, Framework 1.1 and Enterprise
Library 2005 (for framework 1.1).

I've used the Enterprise Library Configuration utility to create my
connection to SQL Server, however when I run my C# program that calls a
Stored Procedure it fails. Here is what the ConnectionString block looks
like 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>

I noticed that when the Enterprise Library reads the
dataConfiguration.config file it looks for "uid" & "pwd", and strips it out,
so then my connection fails because it doesn't have the correct credentials.

Can anyone tell me why I am can't connect to my DB? Is there another step I
need to take in my C# program to make the connection? Here's what the code
looks like:
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);
Thanks,
Sep 15 '06 #1
6 1443
Hi SAL,

Is the error security-related?

Try setting persist security info to True.

--
Dave Sexton

"SAL" <SA*@discussions.microsoft.comwrote in message news:F6**********************************@microsof t.com...
Hello,

Currently, I'm using Visual Studio 2003, C#, Framework 1.1 and Enterprise
Library 2005 (for framework 1.1).

I've used the Enterprise Library Configuration utility to create my
connection to SQL Server, however when I run my C# program that calls a
Stored Procedure it fails. Here is what the ConnectionString block looks
like 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>

I noticed that when the Enterprise Library reads the
dataConfiguration.config file it looks for "uid" & "pwd", and strips it out,
so then my connection fails because it doesn't have the correct credentials.

Can anyone tell me why I am can't connect to my DB? Is there another step I
need to take in my C# program to make the connection? Here's what the code
looks like:
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);
Thanks,


Sep 15 '06 #2
SAL
Yes, because ConnectionStringNoCredentials() searches for uid & pwd and
removes it, then builds the connectionString with-out and I'm not sure why.

I have not been able to find anything on the internet who's using the EntLib
1 who have experienced this.

"Dave Sexton" wrote:
Hi SAL,

Is the error security-related?

Try setting persist security info to True.

--
Dave Sexton

"SAL" <SA*@discussions.microsoft.comwrote in message news:F6**********************************@microsof t.com...
Hello,

Currently, I'm using Visual Studio 2003, C#, Framework 1.1 and Enterprise
Library 2005 (for framework 1.1).

I've used the Enterprise Library Configuration utility to create my
connection to SQL Server, however when I run my C# program that calls a
Stored Procedure it fails. Here is what the ConnectionString block looks
like 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>

I noticed that when the Enterprise Library reads the
dataConfiguration.config file it looks for "uid" & "pwd", and strips it out,
so then my connection fails because it doesn't have the correct credentials.

Can anyone tell me why I am can't connect to my DB? Is there another step I
need to take in my C# program to make the connection? Here's what the code
looks like:
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);
Thanks,


Sep 15 '06 #3
SAL
In other words,

The ConnectionStringBuilder in the Enterprise Library 1.0 builds the
connectiong string like this:

data source=sql123;initial catalog=MyDb;persist security info=true;packet
size=4096

Instead of like this:

data source=SQL123;initial catalog=MyDb;persist security info=False;user
id=youruid;;packet size=4096; password=yourpwd"

I don't know if there's a step I'm missing in my C# program, but the only
reason I'm using the dataConfiguration.config with a uid & pwd in it is
because it's an App without a UI.

"Dave Sexton" wrote:
Hi SAL,

Is the error security-related?

Try setting persist security info to True.

--
Dave Sexton

"SAL" <SA*@discussions.microsoft.comwrote in message news:F6**********************************@microsof t.com...
Hello,

Currently, I'm using Visual Studio 2003, C#, Framework 1.1 and Enterprise
Library 2005 (for framework 1.1).

I've used the Enterprise Library Configuration utility to create my
connection to SQL Server, however when I run my C# program that calls a
Stored Procedure it fails. Here is what the ConnectionString block looks
like 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>

I noticed that when the Enterprise Library reads the
dataConfiguration.config file it looks for "uid" & "pwd", and strips it out,
so then my connection fails because it doesn't have the correct credentials.

Can anyone tell me why I am can't connect to my DB? Is there another step I
need to take in my C# program to make the connection? Here's what the code
looks like:
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);
Thanks,


Sep 15 '06 #4
Hi SAL,

So I take it that "persist security info=True" didn't work?

--
Dave Sexton

"SAL" <SA*@discussions.microsoft.comwrote in message news:A8**********************************@microsof t.com...
In other words,

The ConnectionStringBuilder in the Enterprise Library 1.0 builds the
connectiong string like this:

data source=sql123;initial catalog=MyDb;persist security info=true;packet
size=4096

Instead of like this:

data source=SQL123;initial catalog=MyDb;persist security info=False;user
id=youruid;;packet size=4096; password=yourpwd"

I don't know if there's a step I'm missing in my C# program, but the only
reason I'm using the dataConfiguration.config with a uid & pwd in it is
because it's an App without a UI.

"Dave Sexton" wrote:
>Hi SAL,

Is the error security-related?

Try setting persist security info to True.

--
Dave Sexton

"SAL" <SA*@discussions.microsoft.comwrote in message news:F6**********************************@microsof t.com...
Hello,

Currently, I'm using Visual Studio 2003, C#, Framework 1.1 and Enterprise
Library 2005 (for framework 1.1).

I've used the Enterprise Library Configuration utility to create my
connection to SQL Server, however when I run my C# program that calls a
Stored Procedure it fails. Here is what the ConnectionString block looks
like 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>

I noticed that when the Enterprise Library reads the
dataConfiguration.config file it looks for "uid" & "pwd", and strips it out,
so then my connection fails because it doesn't have the correct credentials.

Can anyone tell me why I am can't connect to my DB? Is there another step I
need to take in my C# program to make the connection? Here's what the code
looks like:
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);
Thanks,




Sep 15 '06 #5
SAL
No, unfortunately.

"Dave Sexton" wrote:
Hi SAL,

So I take it that "persist security info=True" didn't work?

--
Dave Sexton

"SAL" <SA*@discussions.microsoft.comwrote in message news:A8**********************************@microsof t.com...
In other words,

The ConnectionStringBuilder in the Enterprise Library 1.0 builds the
connectiong string like this:

data source=sql123;initial catalog=MyDb;persist security info=true;packet
size=4096

Instead of like this:

data source=SQL123;initial catalog=MyDb;persist security info=False;user
id=youruid;;packet size=4096; password=yourpwd"

I don't know if there's a step I'm missing in my C# program, but the only
reason I'm using the dataConfiguration.config with a uid & pwd in it is
because it's an App without a UI.

"Dave Sexton" wrote:
Hi SAL,

Is the error security-related?

Try setting persist security info to True.

--
Dave Sexton

"SAL" <SA*@discussions.microsoft.comwrote in message news:F6**********************************@microsof t.com...
Hello,

Currently, I'm using Visual Studio 2003, C#, Framework 1.1 and Enterprise
Library 2005 (for framework 1.1).

I've used the Enterprise Library Configuration utility to create my
connection to SQL Server, however when I run my C# program that calls a
Stored Procedure it fails. Here is what the ConnectionString block looks
like 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>

I noticed that when the Enterprise Library reads the
dataConfiguration.config file it looks for "uid" & "pwd", and strips it out,
so then my connection fails because it doesn't have the correct credentials.

Can anyone tell me why I am can't connect to my DB? Is there another step I
need to take in my C# program to make the connection? Here's what the code
looks like:
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);
Thanks,




Sep 15 '06 #6
SAL
It turns out, that someone changed the Initial Catalog value to include an
underscore (_) and I was unaware of it. As soon as I changed it, it worked
like a charm.

"Dave Sexton" wrote:
Hi SAL,

So I take it that "persist security info=True" didn't work?

--
Dave Sexton

"SAL" <SA*@discussions.microsoft.comwrote in message news:A8**********************************@microsof t.com...
In other words,

The ConnectionStringBuilder in the Enterprise Library 1.0 builds the
connectiong string like this:

data source=sql123;initial catalog=MyDb;persist security info=true;packet
size=4096

Instead of like this:

data source=SQL123;initial catalog=MyDb;persist security info=False;user
id=youruid;;packet size=4096; password=yourpwd"

I don't know if there's a step I'm missing in my C# program, but the only
reason I'm using the dataConfiguration.config with a uid & pwd in it is
because it's an App without a UI.

"Dave Sexton" wrote:
Hi SAL,

Is the error security-related?

Try setting persist security info to True.

--
Dave Sexton

"SAL" <SA*@discussions.microsoft.comwrote in message news:F6**********************************@microsof t.com...
Hello,

Currently, I'm using Visual Studio 2003, C#, Framework 1.1 and Enterprise
Library 2005 (for framework 1.1).

I've used the Enterprise Library Configuration utility to create my
connection to SQL Server, however when I run my C# program that calls a
Stored Procedure it fails. Here is what the ConnectionString block looks
like 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>

I noticed that when the Enterprise Library reads the
dataConfiguration.config file it looks for "uid" & "pwd", and strips it out,
so then my connection fails because it doesn't have the correct credentials.

Can anyone tell me why I am can't connect to my DB? Is there another step I
need to take in my C# program to make the connection? Here's what the code
looks like:
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);
Thanks,




Sep 18 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Lou | last post by:
Please can someone put me out my misery! Im trying to find a multiple user/password protection script that will redirect the specific user to a specific directory. At the moment I have set up...
0
by: Adam Fortuno KOVICK | last post by:
--Boundary_(ID_B/b4ffTtDNz/xCjv2UIigg) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline All, I've been attempting to assign a password...
5
by: MLH | last post by:
I'm supposed to set a password for the MySQL root user. The output of mysql_install_db instructed me to run the following commands... /usr/bin/mysqladmin -u root -h appserver password mynwewpasswd...
15
by: Bart | last post by:
Hi, I receive an utf8 character from a database, like 田 (Japanese Character, style: &#XXXXX). How can I visualize the Japanese character on my application? I have found the class...
0
by: Ken Linder (KC7RAD) | last post by:
All, Is this a bug or a feature? If a user is locked, GetPassword() throws an exception. Here's my web.config entry for the provider... <membership> <providers> <remove...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
0
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
2
by: Kleber | last post by:
Could anyone please help? I'm trying to MATCH the user's UserName and Password imput to the user's UserName & Password from the machine current logged on. User's Input: txtUserName="Joe"...
4
by: suganya | last post by:
Hi By getting the email id from txtEmailId, I have to send the user name & password to that particular email id. For that on button click event I have given the coding as Protected Sub...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.