06-11-18, 06:06 AM
PHP كود :
Private Function GetColumnNamesInTable(ByVal connectionString As String, ByVal tableName As String) As List(Of String)
Dim connection As OleDbConnection = New OleDbConnection(connectionString)
Dim restrictions As String() = New String() {Nothing, Nothing, tableName, Nothing}
connection.Open()
Dim dataTable As DataTable = connection.GetSchema("Columns", restrictions)
connection.Close()
Dim returnList As List(Of String) = New List(Of String)
For Each dataRow As DataRow In dataTable.Rows
returnList.Add(dataRow("Column_Name"))
Next
Return returnList
End Function
PHP كود :
For i As Integer = 0 To GetColumnNamesInTable("connection ", "table name").Count - 1
ComboBox1.Items.Add(i)
Next
