Link to home
Start Free TrialLog in
Avatar of shelbyinfotech
shelbyinfotech

asked on

'System.Data.DataRow' does not contain a property with the name 'AUTONUM'

DataGrid-Error-aspx_vb.txtI'm calling a SQL stored procedure into a DataSet.  Then, putting it into a DataRow so I can Sort and Filter it (later) once it's in the DataRow.  Using Dataset Visualizer, I've confirmed that the dataset does contain data and includes the column 'AUTONUM'.

I can't figure out why I seem getting the error message on the "End If" in the following section of code.

Private Sub ctlList_ItemDataBound(...)

If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Or _
e.Item.ItemType = ListItemType.SelectedItem Then
.
.
.
End If

I copied this code from another one of my projects which does work; but sends a sql string to the server to retrieve the data.  I need to use a Stored Procedure instead.

See attached file for aspx and vb.
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

The problem is most probably in the code that you do not show between the If and the End If. It looks as if you do not use the proper syntax to reference the column somewhere in that code.
Avatar of shelbyinfotech
shelbyinfotech

ASKER

The full code is in the attached text file.
You seem to have forgotten to attach the file.
I see it as a link in the first line of the question ...???
Sorry, I cannot see anything that could cause the error.

I hope somebody else will be able to find the problem.
Avatar of Pavel Celba
This rather seems you are not able to evaluate this expression on your ASPX page:

DataBinder.Eval(Container.DataItem, "AUTONUM")

Try to remove that part and you'll then know where the problem is.
ASKER CERTIFIED SOLUTION
Avatar of mrcoffee365
mrcoffee365
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you that was the problem.
Great.  Good luck!