Okay, for saying you don’t know too much you sure sent a lot of good information. From your info this is what I have so far:
{
UD110exists = false;
morePages = false;
System.Data.DataSet dsUD110;
try
{
UD110Adapter adapterUD110 = new UD110Adapter(this.oTrans);
adapterUD110.BOConnect();
string Key1 = "PMOPERATIONS";
string Key2 = tbTypeCode1.Value.ToString();
string Key3 = tbFreqCode1.Value.ToString();
string Key4 = tbEquipTypeID.Text;
string Key5 = string.Empty;
string wClause = "Key1 = ' " + Key1 + " ' and Key2 = ' " + Key2 + " ' and Key3 = ' " + Key3 + " ' and Key4 = ' " + Key4 + " ' and Key5 = ' " + Key5 + "'";
MessageBox.Show(wClause.ToString());
opts.NamedSearch.WhereClauses.Add("UD110", wClause); ////Error Here
MessageBox.Show("Before getting the Data Set");
dsUD110 = adapterUD110.GetRows(opts, out morePages);
MessageBox.Show("After getting the Data Set");
if(dsUD110.Tables["UD110"].Rows.Count > 0)
{
UD110exists = true;
}
adapterUD110.Dispose();
}
catch (System.Exception ex)
{
ExceptionBox.Show(ex);
}
}
That code works perfectly if a record exists and it sets the UD110 exists to true accordingly.
However, if a UD110 record doesn’t exists I am getting an error where I have shown it in the code. Attached is the error.
Any ideas?