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
Tchala B
NA
52
15.3k
C# code failing to pick user and password from access data
May 16 2017 10:13 AM
I have a windows forms application using ms access database but am having some issue with my login form. When i try to login the code can`t log me in after i input the right password and user name and am wondering what the problem might be
Here is my code
DataSet ds = GetData.getInfo(
"select * from Users where UserName='"
+ txt1 +
"' and Pswd1='"
+ txt2 +
"'"
,
"Users"
);
if
(info.Tables[0].Rows.Count > 0)
{
if
(info.Tables[0].Rows[0][2].ToString() == txt2)
{
getSettings.SessionId =
this
.cmbSession.SelectedIndex;
getSettings.Session =
this
.cmbSession.Text;
if
(!
string
.IsNullOrEmpty(info.Tables[0].Rows[0][
"Role_Id"
].ToString()))
{
getSettings.UserRoleId = Convert.ToInt32(info.Tables[0].Rows[0][
"Role_Id"
]);
getSettings.UserRole =
this
.GetData.getInfo(
"SELECT Role FROM Role_Master WHERE Role_Id="
+ (
object
)getSettings.UserRoleId);
}
this
.DialogResult = DialogResult.OK;
this
.Close();
}
Here is the Users Table
Reply
Answers (
2
)
c# Automatically generate unit test code
Need to "loop" these codes until all records be deleted...