hi all,
I already know how to do the search function..
But I need to do a perfect one.
here is my code which is working
[VB]
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = querySQL;
SqlCeDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
TXT_Description.Text = rdr.GetString(1);
TXT_Something.Text = rdr.GetString(2);
}
cmd = null;
rdr.Close();
[/VB]
so it will return TXT....Text whatever I want to know.. But how should I do if the data not found in the database?
I want to place a message "Data Not Found"
How to code?
I already know how to do the search function..
But I need to do a perfect one.
here is my code which is working
[VB]
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = querySQL;
SqlCeDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
TXT_Description.Text = rdr.GetString(1);
TXT_Something.Text = rdr.GetString(2);
}
cmd = null;
rdr.Close();
[/VB]
so it will return TXT....Text whatever I want to know.. But how should I do if the data not found in the database?
I want to place a message "Data Not Found"
How to code?