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
flummer
NA
10
0
Getting a value from a databse and storing it in a variable
May 25 2005 4:54 AM
I'm currently working on a project in C# in school and I have a problem. I am using a Jet oleDbConnecton to read and store inside my Microsoft Access database. No problem there, i can insert and store values and i can fetch the vaules and put them inside a dataGrid. My problem is this. I have made a login form where the user needs to type in his username and password. This is what i want to do: I want the program to check the username inside the database and then fetch the password that is "connected" to that specific username and then store it in a variable. After that i want to check the textbox with the persons typed password with the password stored inside the variable. How can i achive this? This is what happens when the user pushes the login button. leDbConnection1.Open(); oleDbDataAdapter1.SelectCommand.CommandText = "SELECT Pass FROM Larare WHERE User='"+ text_anvandarnamn.Text +"'"; oleDbDataAdapter1.SelectCommand.ExecuteNonQuery(); oleDbDataAdapter1.Fill(dataSet21,"Pass"); oleDbConnection1.Close(); ////////////////////////////////////////////// If i understand correctly the database has fetched the password and put it inside my dataset now. Assuming that this is the correct way to get the password how do i store it in a variable now? Thanks in advance for any help.
Reply
Answers (
3
)
ODBC driver Question
Query the same datareader more than once