0
Create a private bool variable. In the constructor set the variable to true or false based on the row count. In the forms load event check the variable. Call the forms Close method if needed.
You assign a method in your form to the load event in the InitializeComponent() like so:
this.Load += new System.EventHandler(this.MyLoadHandler);
here is the method
private void MyLoadHandler(object sender, System.EventArgs e)
{
if(NoRows == true)
{
this.Close();
}
}