humor me

(i don't like bound combos they have given me to much nightmares

)
below is a small listitem class you could use (this has always worked for
me)
loop the dataset
'code
dim li as clslistitem
combobox1.items.clear()
for each dr as datarow in ds.tables(0).rows
li = new clslistitem()
li.text = dr(1) 'or dr("Lender")
li.Obj = dr
combobox1.items.add(li)
next
'end code
to use the cbo
dim li as clslistitem
li = combobox1.selecteditem
dim dr as datarow
dr = li.obj
'code
Public Class clsListItem
Private Tekst As String
Private objke As Object
Public Sub New()
Tekst = ""
objke = new Object
End Sub
Public Sub New(ByVal te As String)
Tekst = te
objke = new Object
End Sub
Public Property Text() As String
Get
Return Tekst
End Get
Set(ByVal Value As String)
Tekst = Value
End Set
End Property
Public Property Obj() As Object
Get
Return objke
End Get
Set(ByVal Value As Object)
objke = Value
End Set
End Property
Public Overrides Function ToString() As String
Return Tekst
End Function
End Class
"Mike Fellows" <(E-Mail Removed)> wrote in message
news:AR1%b.975$44.633@newsfe1-win...
> my strconn looks like this
>
> Dim strConn As String =
> "server=Gringotts;uid=*****;pwd=*****;database=lender"
>
> i did a row count on my dataset and both return me 10 rows
>
> now im even more stuck as i now know the data is there just not filling
the
> combobox!
>
> Mike
>
>
> "Gerry O'Brien [MVP]" <(E-Mail Removed)> wrote in message
> news:u1HfiV6%(E-Mail Removed)...
> > Just out of curiousity, you are using strConn as the connection string
for
> > your connection object. You don't display it here, perhaps for security
> > reasons, but my question is this.
> >
> > Are you using a data source name on the 2K box that is not present on
the
> XP
> > box? If your strConn is an actual connection string pointing to a DB,
> > ensure that the location and DB are the same on both systems.
> >
> > One way to debug this real quick is to do a table count or a row count
on
> > the table to see if you are returning any rows at all. This will narrow
> the
> > search as to where the problem lies, either DB connectivity or combo box
> > problem.
> >
> > I'm inclined to believe that for some reason, you are not really
> connecting
> > to the DB.
> >
> > --
> > Gerry O'Brien
> > Visual Developer .NET MVP
> >
> >
> >
> > "Mike Fellows" <(E-Mail Removed)> wrote in message
> > news:7o0%b.959$44.378@newsfe1-win...
> > > when i load my windows form i populate a combobox i use the code below
> > >
> > > Dim conn As New System.Data.SqlClient.SqlConnection(strConn)
> > > Dim sql As String = "AllLenders"
> > > Dim da As New System.Data.SqlClient.SqlDataAdapter(sql, conn)
> > > Dim ds As New DataSet()
> > > da.Fill(ds)
> > > ComboBox1.DataSource = ds.Tables(0)
> > > ComboBox1.DisplayMember = "Lender"
> > > da.Dispose()
> > > ds.Dispose()
> > >
> > >
> > > This code compiles and works perfectly on my win2k box
> > > now when someone takes my compiled executable and runs it on
> > > windows xp, the combobox is not populated!
> > >
> > > Ive also tried compiling it on a windows xp box and it still does not
> > > work
> > >
> > > the sql string is a stored procedure
> > >
> > > im desperate for help with this as ive hit a brick wall!
> > >
> > > Thanks
> > >
> > > Mike Fellows
> > >
> > >
> >
> >
>
>