login failure msg

G

Guest

Just wondering if anyone knows what might be causing this login failure.
I used the data-adapter wizard and selected use an existing connection(also tried new connection that test ok).
I selected use existing stored procedure, for the select operation selected the stored procedure I want to use.
It created the adapter and also an SQLconnection on the page.
So for some reason am getting this login failure. I am able to connect to the dbase in the solution explorer and when I look at the connection string in the data adapter I noticed there is no password value. I have
workstation id="xxxxxx";packet size=4096;user id=xxxxxx;data source="xxxx";persist security info=False;initial catalog=Vehicle_Mileage
here is the error message.
Login failed for user 'MileageWeb'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'MileageWeb'.
Source Error:= line 72

Line 70: Me.SqlDataAdapter1.SelectCommand().Parameters("@EndDate").Value() = "1/6/2003"
Line 71: Me.SqlDataAdapter1.SelectCommand().Parameters("@StartDate").Value() = "1/1/2003"
Line 72: SqlDataAdapter1.Fill(ds_vhist, "VehicleReservation")

Thanks Paul.
 
M

Miha Markic

Hi Paul,

You are using asp.net application, right?
If so, you have a few options: either pass username and password within
connection string (sql authentication) or change the account under which the
application runs (by default it is aspnet account with very few privileges).

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Paul said:
Just wondering if anyone knows what might be causing this login failure.
I used the data-adapter wizard and selected use an existing
connection(also tried new connection that test ok).
I selected use existing stored procedure, for the select operation
selected the stored procedure I want to use.
It created the adapter and also an SQLconnection on the page.
So for some reason am getting this login failure. I am able to connect
to the dbase in the solution explorer and when I look at the connection
string in the data adapter I noticed there is no password value. I have
workstation id="xxxxxx";packet size=4096;user id=xxxxxx;data
source="xxxx";persist security info=False;initial catalog=Vehicle_Mileage
here is the error message.
Login failed for user 'MileageWeb'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'MileageWeb'.
Source Error:= line 72

Line 70:
Me.SqlDataAdapter1.SelectCommand().Parameters("@EndDate").Value() =
"1/6/2003"
Me.SqlDataAdapter1.SelectCommand().Parameters("@StartDate").Value() =
"1/1/2003"
 
G

Guest

yep, using asp.net. In my web.config file I have windows authentication, so can I still pass the userstring and password to
the connection string, also could you provide a brief example or point me in the right direction? Thanks
 
M

Miha Markic

Hi Paul,

Try this:
Put a line into
web.config file somewhere under
<system.web> node:

<identity impersonate="true" userName="USER" password="PASSWORD"/>

Now, your app will run under given user account.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Paul said:
yep, using asp.net. In my web.config file I have windows authentication,
so can I still pass the userstring and password to
the connection string, also could you provide a brief example or point me
in the right direction? Thanks .
 
M

Miha Markic

Private variable sounds good enough to share data through form.
You might post some code.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Paul said:
ok thanks Miha, also had a quick vb.net question. I can post it to another
group if you do not know the problem.
I have 2 calenders on a form and am setting a seperate variable for both
calender selections. I need to have the variables have scope
for the entire form, that is what is set in calender1 selection visible in
calender 2 selection function. I tried using the
Private test1 as string and private test2 as string. After seting test1
from calender1 selection I put a beakpt in the calender 2 function and
test1= nothing when I look at this. Thanks Paul.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top