Hi all,
Wen i bind a drop down list, its giving me an error,

*"System.Data.DataRowView does not contain property with the name 'Subject"*

The code is as follows to populate dropdownlist

Dim con as new sqlconnection(constr)
Dim strsql as string="Select distinct Subjectname from Subject"
Dim ds as new Dataset
con.Open()
Dim cmd as New SqlCommand(strsql,con)
Dim Adapt as New SqlDataAdapter(cmd)
Adapt.Fill(ds,"Subject")
subopt.Datasource=ds.tables(0)
subopt.DataMember="Subject"
subopt.DatatextField="Subject"
subopt.Databind()   --- Error

Pls tell me hw to solve this???

Regards
Jeena

Reply via email to