Click here to Skip to main content
16,021,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I can't read parameter "zyd" and actually "b" . How can I read this? I cant find any problem. But I think have logical problem. My SQL table--> KullaniciAdi | Sifre
a | b
NULL | NULL
static string zyd;
[WebMethod]
public void deneme()
{
    string b="a";
    string KullaniciAdi = "a";
    string connect = "Data Source=BERKAY-PC\\SQLEXPRESS;Initial Catalog=Hastahane;Integrated Security=True;";
    SqlConnection deneme = new SqlConnection(connect);
    SqlCommand komut = new SqlCommand("SELECT * FROM Giris where KullaniciAdi='" + KullaniciAdi + "'order by KullaniciAdi desc", deneme);

    try
    {
        deneme.Open();
        SqlDataReader oku = komut.ExecuteReader();
        while (oku.Read())
        {
            b = oku["Sifre"].ToString();
        }
    }
    finally
    {
        deneme.Close();
        komut.Dispose();
    }
    zyd=b;
}
Posted
Comments
[no name] 20-Jun-13 6:48am    
Try adding a space between the ' and order, "' order by KullaniciAdi desc"

You are sorting KullaniciAdi to descending. Verify the records for KullaniciAdi ='a'.
 
Share this answer
 
Solved. "zyd=b" is false. "zyd=b.tostring();" is true.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900