ASP.NET - Como saber se select Retornou registros
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
Curtidas 0
Respostas
Ericshiba
12/06/2006
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´ ;
GOSTEI 0