I am using the following code on a web form
public DataView CreateEquipmentDataSource(
string equipConnect = "Provider=\"MSDAORA.1\";" + GetConnectionString() + ""
string equipSelect = "Select Description, Isrunning, to_char(Warrantyexpdate, 'mm/dd/yyyy')Expdate"
" from Equipment where Eqnum = " + "'" + equipLabel.Text.ToUpper() + "'"
oda1 = new OleDbDataAdapter(equipSelect, equipConnect)
DataSet ds1 = new DataSet()
oda1.Fill(ds1, "Equip")
DataView Equip = ds1.Tables["Equip"].DefaultView
return Equip
public void FillEquipment(
DataView eq = CreateEquipmentDataSource()
equipDescLabel.Text = eq[0].Row["Description"].ToString()
eqUpLabel.Text = eq[0].Row["Isrunning"].ToString()
When running this code, I get the following error
Index 0 is not non-negative and below total rows count
How do I amend my code to make sure that at least one record is returned
Thanks
Dave