Загрузка...

Helppanite I do authorization for Kursoch

Thread in C# created by stjesus_inactive301411 Mar 26, 2018. 225 views

  1. stjesus_inactive301411
    stjesus_inactive301411 Topic starter Mar 26, 2018 Banned 2 Feb 14, 2018
    ошибка [IMG] pixs.ru/showimage/tGUIRNSoqc_4801605_29762834.jpg[/IMG]
    код
    Code
     SqlConnection cn = new SqlConnection("Data Source=(local);Initial Catalog=login1;Integrated Security=True");
    cn.Open();
    SqlCommand cmd = new SqlCommand("select * from user1 where username = '" +textBox1.Text+ "' and password = '" +textBox2.Text+ "'", cn);
    SqlDataReader dr;
    dr = cmd.ExecuteReader () ;
    int count = 0;
    while (dr.Read())
    {
    count += 1;

    }
    if (count == 1)
    {
    MessageBox.Show("Успешно вошли");
    Form3 f3 = new Form3();
    f3.Show();

    }
    else if (count >0)
    {
    MessageBox.Show ("дубликат");
    }
    else
    {
    MessageBox.Show("Логин или пароль введен не правильно");
    }

    textBox1.Clear();
    textBox2.Clear();
     
  2. renameduser_110248
    Оно же тебе говорит что нету username
     
  3. stjesus_inactive301411
    stjesus_inactive301411 Topic starter Mar 26, 2018 Banned 2 Feb 14, 2018
    спасибо уже разобрался, сделал теперь делаю регистрацию
     
  4. stjesus_inactive301411
    stjesus_inactive301411 Topic starter Mar 27, 2018 Banned 2 Feb 14, 2018
    спасибо,запомню
     
  5. stjesus_inactive301411
    stjesus_inactive301411 Topic starter Mar 27, 2018 Banned 2 Feb 14, 2018
    авторизацию я сделал уже , лучше теперь с регистрацией помоги) ХД
     
Loading...
Top