if you want to know that if the currently entered challan number exits in database or not then you may check the number of rows having the challan number as its entry i.e.
DataTable dt;
SqlCommand cmd = new SqlCommand("SELECT * FROM yourtablename WHERE ChallanNum=@challanNum");
SqlDataAdapter adap = new SqlDataAdapter(cmd, con);
adap.Fill(dt);
if(dt.rows.count>0)
{
MessageBox.Show("Challan Number Already Exists In Database");
}
else
{
}
Hope this solution has meet ur requirement