TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
T
NA
5
0
Problem connecting to the database !!!
Jun 29 2006 6:10 AM
Hi,
I am new to .net. I'm developing a sample web application in ASP .net (using C#). I am trying to connect to the database & i keep getting this error. I'm trying to authenticate the username & password that the user enters with my backend table & print it on the page. But I keep getting -->
Login failed for user 'CRM\ASPNET'.
Exception Details:
System.Data.SqlClient.SqlException: Login failed for user 'CRM\ASPNET'.
My code is :
myConn =
new
SqlConnection("Initial Catalog=repository;Data Source=localhost;Integrated Security=SSPI;");
myCmd = myConn.CreateCommand();
myCmd.CommandText = "SELECT loginname, password FROM Employee
where loginname = '"+TextBox1.Text +"' and password = '"+TextBox2.Text+"'";
myConn.Open();
myReader = myCmd.ExecuteReader();
while
(myReader.Read())
{
results = results + myReader.GetString(0) + ", " + myReader.GetString(1) ;
}
Can anyone help me debug this problem. I cannot proceed further till i solve this...PLZ HELP!!!!
Reply
Answers (
5
)
Connection String using DSN
ASP.Net 2.0 - connecting to a dBase folder