locked
is that wrong syntax ? RRS feed

  • Question

  • public void GirisYap(Kayıt veri) { SqlConnection bag = new SqlConnection(baglantı_yolu); bag.Open(); SqlCommand emir = new SqlCommand("select AD,SIFRE from AnaTablo where AD=@AD,SIFRE=@SIFRE",bag); emir.Parameters.Add("@AD", System.Data.SqlDbType.VarChar).Value = veri.AD; emir.Parameters.Add("@SIFRE",System.Data.SqlDbType.VarChar).Value = veri.SIFRE; emir.ExecuteNonQuery(); SqlDataReader okuyan = emir.ExecuteReader(); bool onay; while (okuyan.Read()) {

    //AD= user name and SIFRE=user password if (veri.AD == okuyan["AD"].ToString() && veri.SIFRE == okuyan["SIFRE"].ToString()) { onay = true; break; } else { onay = false; } } bag.Close();

    i'm trying user login from windowsphone  ,using wcf

    is that wrong ?


    yok

    • Moved by Bob Beauchemin Friday, April 24, 2015 4:38 PM Moved to the SqlClient client-side forum for best results
    Friday, April 24, 2015 11:09 AM

Answers

  • You don't indicate what the error is but I will take a guess:

    select AD, SIFRE from AnaTablo where AD=@AD AND SIFRE=@SIFRE


    Paul ~~~~ Microsoft MVP (Visual Basic)

    • Proposed as answer by Fred Bao Monday, April 27, 2015 2:31 AM
    • Marked as answer by Fred Bao Tuesday, May 5, 2015 8:50 AM
    Friday, April 24, 2015 8:33 PM