|
-
May 19th, 2012, 02:21 AM
#1
Thread Starter
Junior Member
combobox is displaying null values
the combox is bound database table,but it is not displaying the contents of table in database,instead it is displaying corresponding null values(blank).it is showing just "select" and the blank spaces corresponding to the number of items in database
here is my code:
Function combobfill() As DataSet
addconnection.Open()
Dim selectstring As String = "select materialsname from materialtype_table"
Try
Dim da As New SqlDataAdapter(selectstring, addconnection)
Dim ds As New DataSet
ds.Tables.Add("mymaterial")
ds.Tables("mymaterial").Columns.Add("material")
ds.Tables("mymaterial").Rows.Add("Select")
da.Fill(ds, "mymaterial")
Return ds
Catch ex As Exception
MsgBox(ex.Message)
Finally
addconnection.Close()
End Try
Dim dsd As DataSet = Nothing
Return dsd
addconnection.Close()
End Function
Dim ds As DataSet = combofillobj.combobfill()
ComboBox_Mtype.DataSource = ds.Tables(0)
ComboBox_Mtype.DisplayMember = "material"
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|