ASP.NET - Como saber se select Retornou registros
12/06/2006
0
estou utilizando o seguinte código:
Sendo que esta instrução não retorna nenhum registro mas mesmo assim o TextBox1 é preenchido, alguem tem alguma idéia do que está errado?
fbConnection1.Open; fbCommand1.CommandText := ´Select * from usuarios where usuario_id = 45646546546´; Dr := fbCommand1.ExecuteReader; if dr.HasRows then begin DR.Read; TextBox1.Text := ´tem registros´ end else begin TextBox1.Text := ´Não tem registros´ end;
Sendo que esta instrução não retorna nenhum registro mas mesmo assim o TextBox1 é preenchido, alguem tem alguma idéia do que está errado?
Steve_narancic
Curtir tópico
+ 0
Responder
Posts
20/06/2006
Ericshiba
steve_narancic,
Tente fazer assim:
if DR.Read then
TextBox1.Text := ´tem registros´
else
TextBox1.Text := ´Não tem registros´ ;
Tente fazer assim:
if DR.Read then
TextBox1.Text := ´tem registros´
else
TextBox1.Text := ´Não tem registros´ ;
Responder
Clique aqui para fazer login e interagir na Comunidade :)