Hi buddy..
as per you requirement may this code help you...
string query="select Staff Name from StaffLeaveDetails where date ='"textbox1.text"' ";
con.open()
SqlCommand cmd=new sqlcommand(con,query)
sqlDataReader dr=cmd.executeReader();
if(dr.read())
{
messageBox.show("Select different Date for this staff");
}
else
{
messageBox.show("This staff is free on this date");
}
con.close();
condition is true but just take a look on Sql connection procedure..but overall it helps you buddy if any problem comment below plz
Happy to help