In an attempt to add some parameter validation and correct usage semantics to our application, we are trying to add correct exception handling to our .NET applications.
My question is this: When throwing exceptions in ADO.NET if a particular query returns no data or the data could not be found, what type of exception should I use?
Psuedocode: (read, don't scrutinize the semantics of the code, I know it won't compile)
public DataSet GetData(int identifier)
{
dataAdapter.Command.Text = "Select * from table1 Where ident = " + identifier.toString();
DataSet ds = dataAdapter.Fill(ds);
if (ds.table1.Rows.Count == 0)
throw new Exception("Data not found");
return ds;
}