MS 04.09.2015 1
This commit is contained in:
@@ -175,16 +175,29 @@ Public Class frmSQLEditor
|
||||
End Sub
|
||||
|
||||
Private Sub GetColumns(tableName As String, ByRef combobox As ComboBox)
|
||||
Dim SQL As String = "SELECT name FROM sys.columns WHERE object_id = OBJECT_ID('" & tableName & "') ORDER BY name"
|
||||
Dim ds As DataSet = ExecuteWithConnection(cmbConnection.SelectedValue, SQL)
|
||||
Try
|
||||
Dim CS As String
|
||||
CS = ClassDatabase.GetConnectionString(cmbConnection.SelectedValue)
|
||||
Dim typeCS As String = ClassDatabase.Execute_Scalar("SELECT SQL_PROVIDER FROM TBDD_CONNECTION WHERE GUID = " & cmbConnection.SelectedValue, True)
|
||||
Dim SQL As String
|
||||
Dim DT As DataTable
|
||||
If typeCS.ToUpper = "Oracle".ToUpper Then
|
||||
SQL = "select COLUMN_NAME from USER_TAB_COLS where TABLE_NAME='" & tableName & "' order by COLUMN_NAME"
|
||||
DT = ClassDatabase.Oracle_Return_Datatable(SQL, CS, True)
|
||||
Else
|
||||
SQL = "SELECT name FROM sys.columns WHERE object_id = OBJECT_ID('" & tableName & "') ORDER BY name"
|
||||
DT = ClassDatabase.Return_Datatable_CS(SQL, CS, True)
|
||||
End If
|
||||
|
||||
If ds IsNot Nothing Then
|
||||
combobox.Items.Clear()
|
||||
|
||||
For Each row As DataRow In ds.Tables(0).Rows
|
||||
combobox.Items.Add(row.Item(0))
|
||||
Next
|
||||
End If
|
||||
If DT IsNot Nothing Then
|
||||
combobox.Items.Clear()
|
||||
For Each row As DataRow In DT.Rows
|
||||
combobox.Items.Add(row.Item(0))
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in GetColumns:")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub GetColumns(tableName As String, ByRef combobox As DevExpress.XtraEditors.CheckedComboBoxEdit)
|
||||
|
||||
Reference in New Issue
Block a user