0

i want make login form in c#. but i dont have access. and i cant use sql server . can you help me. why am i getting an error i make this code

        OdbcConnection con;
        OdbcCommand cmd;
        OdbcDataReader dr;
        private void button1_Click(object sender, EventArgs e)
        {
            string ad = textBox1.Text;
            string sifre = textBox2.Text;
            con = new OdbcConnection("Provider=Microsoft.ACE.Odbc.12.0;Data Source=dat.odb");
            cmd = new OdbcCommand();
            con.Open();
            cmd.Connection = con;
            cmd.CommandText = "SELECT * FROM kullan where ad='" + textBox1.Text + "' AND sifre='" + textBox2.Text + "'";
            dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                Form2 f2 = new Form2();
                f2.Show();
            }
            else
            {
                MessageBox.Show("Kullanıcı adı ya da şifre yanlış");
            }

            con.Close();

        }
Acbst
  • 1
  • You want to make a login system, without any form of backend to store the proper user/pw combinations in??? – Christopher May 04 '20 at 15:56
  • Not using parameterized queries is unacceptable. – Honeyboy Wilson May 04 '20 at 15:58
  • You will need to post the error that you are getting along with the code sample you already have. As it stands this question does not supply enough information to get a good answer back. – Nik P May 04 '20 at 19:44

0 Answers0