G
Guest
When I run the following code
public DataView CreateEquipmentDataSource(
string equipConnect = "Provider=\"MSDAORA.1\";" + GetConnectionString() + ""
string equipSelect = "Select Description from Equipment where"
" Eqnum = " + "'" + equipLabel.Text + "'"
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()
I get the following error
Server Error in '/5YearPlan' Application.
Index 0 is not non-negative and below total rows count.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index 0 is not non-negative and below total rows count
Source Error:
Line 302:
Line 303: DataView eq = CreateEquipmentDataSource()
Line 304: equipDescLabel.Text = eq[0].Row["Description"].ToString()
Line 305:
Line 306
Source File: c:\inetpub\wwwroot\5yearplan\workorderform.aspx.cs Line: 304
Stack Trace:
[IndexOutOfRangeException: Index 0 is not non-negative and below total rows count.
System.Data.DataView.GetElement(Int32 index) +4
System.Data.DataView.get_Item(Int32 recordIndex) +
_5YearPlan.workorderForm.FillEquipment() in c:\inetpub\wwwroot\5yearplan\workorderform.aspx.cs:30
_5YearPlan.workorderForm.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\5yearplan\workorderform.aspx.cs:16
System.Web.UI.Control.OnLoad(EventArgs e) +6
System.Web.UI.Control.LoadRecursive() +3
System.Web.UI.Page.ProcessRequestMain() +73
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.57
Do you have any idea what is causing this
Thanks
Dav
public DataView CreateEquipmentDataSource(
string equipConnect = "Provider=\"MSDAORA.1\";" + GetConnectionString() + ""
string equipSelect = "Select Description from Equipment where"
" Eqnum = " + "'" + equipLabel.Text + "'"
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()
I get the following error
Server Error in '/5YearPlan' Application.
Index 0 is not non-negative and below total rows count.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index 0 is not non-negative and below total rows count
Source Error:
Line 302:
Line 303: DataView eq = CreateEquipmentDataSource()
Line 304: equipDescLabel.Text = eq[0].Row["Description"].ToString()
Line 305:
Line 306
Source File: c:\inetpub\wwwroot\5yearplan\workorderform.aspx.cs Line: 304
Stack Trace:
[IndexOutOfRangeException: Index 0 is not non-negative and below total rows count.
System.Data.DataView.GetElement(Int32 index) +4
System.Data.DataView.get_Item(Int32 recordIndex) +
_5YearPlan.workorderForm.FillEquipment() in c:\inetpub\wwwroot\5yearplan\workorderform.aspx.cs:30
_5YearPlan.workorderForm.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\5yearplan\workorderform.aspx.cs:16
System.Web.UI.Control.OnLoad(EventArgs e) +6
System.Web.UI.Control.LoadRecursive() +3
System.Web.UI.Page.ProcessRequestMain() +73
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.57
Do you have any idea what is causing this
Thanks
Dav