Good answer by Raghu.


On Mar 17, 10:49 am, Jeena Ajiesh <[email protected]> wrote:
> Oh.. Thank You very much......
> U had point out the mistake....
>
> On Sun, Mar 15, 2009 at 5:22 PM, Lee Gunn <[email protected]>wrote:
>
>
>
>
>
> > Hi,
>
> > You SQL string is:
>
> > "Select distinct Subjectname from Subject"
>
> > Therefore you should set your data properties to:
>
> > subopt.DataMember="Subjectname"
> > subopt.DatatextField="Subjectname"
>
> > Lee
>
> > -------
> >http://www.jiba-jaba.com
> >http://www.secretorange.co.uk
>
> > ________________________________
>
> > From: [email protected] on behalf of Jeena Ajiesh
> > Sent: Sun 15/03/2009 13:21
> > To: [email protected]
> > Subject: [DotNetDevelopment] Datbind error.
>
> > 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
>
> --
> ****************
> Regards,
> ♪♥♫♥Ĵєєήǎ ♫♥♪♥
> Email: [email protected]
>          [email protected]
>          [email protected]
>
> Sent from: Dubayy  United Arab Emirates.

Reply via email to