I have the following dataset and datatable:
1 Code:
Dim topics As New DataSet() Public Function JT_PullData(ByVal TableName As String) As DataTable If topics.Tables.Count >= 1 Then topics.Clear() names = Nothing intSetArray = 0 i = 0 End If Dim conn As String = "Server=192.168.0.36;Port=3306;Database=wc;Uid=root;Pwd=123454321" Dim cmd As String = "SELECT * FROM " & TableName Dim ad As New MySql.Data.MySqlClient.MySqlDataAdapter(cmd, conn) ad.GetFillParameters() ad.Fill(topics) Dim dr As DataRow Dim dt As DataTable dt = topics.Tables(0) intSetArray = dt.Rows.Count ReDim names(intSetArray, 4) For Each dr In dt.Rows names(i, 1) = dr(1) 'Username names(i, 2) = dr(2) 'Password names(i, 3) = dr(3) 'Active names(i, 4) = dr(4) 'Accesslevel i += 1 Next topics.Dispose() JT_PullData = topics.Tables(0) End Function
Now I have a column in my DataGridViewer that is a dropdown list. This list is to be populated by the datasel above.
I can't seem to get it to work. Help me, please
Here is an image:
I am supposed to set the dataset and then set the values that would be shown. (all by code )




Reply With Quote
