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
Stylus STYLUS
NA
17
1.3k
Get user name from one form to another c#
May 23 2018 4:11 AM
Get user name from one form to another
access rights
I have error in line 28
{"Invalid column name 'a'."}
a is username and pasword
private
static
int
korisnikId;
private
static
int
korisnickaGrupa;
private
string korisnickoIme;
public
void
findsUserName()
{
SqlConnection myConnection =
new
SqlConnection(cs);
String command =
"SELECT ime_prezime FROM osobe_korisnici where id = \""
+ korisnikId +
"\""
;
SqlCommand myCommand =
new
SqlCommand(command, myConnection);
myCommand.Connection.Open();
this
.korisnickoIme = myCommand.ExecuteScalar().ToString();
}
private
void
prijava()
if
(korisnikId > 0)
{
command =
"SELECT osobe_korisnici.lozinka FROM osobe_korisnici where osobe_korisnici.id = "
+ korisnikId;
SqlCommand myCommand2 =
new
SqlCommand(command, myConnection);
String lozinka = myCommand2.ExecuteScalar().ToString();
if
(lozinka == lozinkaTextBox.Text)
{
command =
"SELECT korisnik_grupa.redni_broj FROM korisnik_grupa where korisnik_grupa.broj_grupe = \""
+ korisnikId +
"\""
;
SqlCommand myCommand3 =
new
SqlCommand(command, myConnection);
korisnickaGrupa = Int32.Parse(myCommand3.ExecuteScalar().ToString());
if
(korisnickaGrupa == 1)
{
findsUserName();
DialogResult = DialogResult.OK;
}
else
{
errorLabel.Text =
"You dont have acces for this app"
;
}
}
else
{
errorLabel.Text =
"Wrong password"
;
}
}
else
{
errorLabel.Text =
"Wrong user name"
;
}
}
Reply
Answers (
2
)
how to check for this id this answers
Stripe Payment gateway integration for windows wcf service.