You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
131 lines
8.4 KiB
131 lines
8.4 KiB
Public Class frmSysadminTableSelector
|
|
Inherits System.Windows.Forms.Form
|
|
|
|
#Region " Vom Windows Form Designer generierter Code "
|
|
|
|
Public Sub New()
|
|
MyBase.New()
|
|
|
|
' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
|
|
InitializeComponent()
|
|
|
|
' Initialisierungen nach dem Aufruf InitializeComponent() hinzufügen
|
|
|
|
End Sub
|
|
|
|
' Die Form überschreibt den Löschvorgang der Basisklasse, um Komponenten zu bereinigen.
|
|
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
|
If disposing Then
|
|
If Not (components Is Nothing) Then
|
|
components.Dispose()
|
|
End If
|
|
End If
|
|
MyBase.Dispose(disposing)
|
|
End Sub
|
|
|
|
' Für Windows Form-Designer erforderlich
|
|
Private components As System.ComponentModel.IContainer
|
|
|
|
'HINWEIS: Die folgende Prozedur ist für den Windows Form-Designer erforderlich
|
|
'Sie kann mit dem Windows Form-Designer modifiziert werden.
|
|
'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
|
|
Friend WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter
|
|
Friend WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
|
|
Friend WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
|
|
Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
|
|
Friend WithEvents DataSet1 As System.Data.DataSet
|
|
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
|
|
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
|
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter()
|
|
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand()
|
|
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection()
|
|
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand()
|
|
Me.DataSet1 = New System.Data.DataSet()
|
|
Me.ListBox1 = New System.Windows.Forms.ListBox()
|
|
CType(Me.DataSet1, System.ComponentModel.ISupportInitialize).BeginInit()
|
|
Me.SuspendLayout()
|
|
'
|
|
'SqlDataAdapter1
|
|
'
|
|
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
|
|
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
|
|
Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "sysobjects", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("name", "name"), New System.Data.Common.DataColumnMapping("id", "id"), New System.Data.Common.DataColumnMapping("xtype", "xtype"), New System.Data.Common.DataColumnMapping("uid", "uid"), New System.Data.Common.DataColumnMapping("info", "info"), New System.Data.Common.DataColumnMapping("status", "status"), New System.Data.Common.DataColumnMapping("base_schema_ver", "base_schema_ver"), New System.Data.Common.DataColumnMapping("replinfo", "replinfo"), New System.Data.Common.DataColumnMapping("parent_obj", "parent_obj"), New System.Data.Common.DataColumnMapping("crdate", "crdate"), New System.Data.Common.DataColumnMapping("ftcatid", "ftcatid"), New System.Data.Common.DataColumnMapping("schema_ver", "schema_ver"), New System.Data.Common.DataColumnMapping("stats_schema_ver", "stats_schema_ver"), New System.Data.Common.DataColumnMapping("type", "type"), New System.Data.Common.DataColumnMapping("userstat", "userstat"), New System.Data.Common.DataColumnMapping("sysstat", "sysstat"), New System.Data.Common.DataColumnMapping("indexdel", "indexdel"), New System.Data.Common.DataColumnMapping("refdate", "refdate"), New System.Data.Common.DataColumnMapping("version", "version"), New System.Data.Common.DataColumnMapping("deltrig", "deltrig"), New System.Data.Common.DataColumnMapping("instrig", "instrig"), New System.Data.Common.DataColumnMapping("updtrig", "updtrig"), New System.Data.Common.DataColumnMapping("seltrig", "seltrig"), New System.Data.Common.DataColumnMapping("category", "category"), New System.Data.Common.DataColumnMapping("cache", "cache")})})
|
|
'
|
|
'SqlInsertCommand1
|
|
'
|
|
Me.SqlInsertCommand1.CommandText = "[pv_sysobjects_insert]"
|
|
Me.SqlInsertCommand1.CommandType = System.Data.CommandType.StoredProcedure
|
|
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@name", System.Data.SqlDbType.NVarChar, 128, "name"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@id", System.Data.SqlDbType.Int, 4, "id"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@xtype", System.Data.SqlDbType.VarChar, 2, "xtype"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@uid", System.Data.SqlDbType.Int, 2, "uid"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@info", System.Data.SqlDbType.Int, 2, "info"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@status", System.Data.SqlDbType.Int, 4, "status"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@base_schema_ver", System.Data.SqlDbType.Int, 4, "base_schema_ver"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@replinfo", System.Data.SqlDbType.Int, 4, "replinfo"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@parent_obj", System.Data.SqlDbType.Int, 4, "parent_obj"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@crdate", System.Data.SqlDbType.DateTime, 8, "crdate"))
|
|
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ftcatid", System.Data.SqlDbType.Int, 2, "ftcatid"))
|
|
'
|
|
'SqlConnection1
|
|
'
|
|
Me.SqlConnection1.ConnectionString = "data source=shu;initial catalog=edoka;persist security info=False;user id=sa;work" & _
|
|
"station id=SHU;packet size=4096"
|
|
'
|
|
'SqlSelectCommand1
|
|
'
|
|
Me.SqlSelectCommand1.CommandText = "[pv_sysobjects_select]"
|
|
Me.SqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure
|
|
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
|
|
Me.SqlSelectCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
|
|
'
|
|
'DataSet1
|
|
'
|
|
Me.DataSet1.DataSetName = "NewDataSet"
|
|
'
|
|
'ListBox1
|
|
'
|
|
Me.ListBox1.Location = New System.Drawing.Point(8, 16)
|
|
Me.ListBox1.Name = "ListBox1"
|
|
Me.ListBox1.Size = New System.Drawing.Size(240, 316)
|
|
Me.ListBox1.TabIndex = 0
|
|
'
|
|
'frmSysadminTableSelector
|
|
'
|
|
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
|
Me.ClientSize = New System.Drawing.Size(256, 349)
|
|
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.ListBox1})
|
|
Me.Name = "frmSysadminTableSelector"
|
|
Me.Text = "Tabelle auswählen"
|
|
CType(Me.DataSet1, System.ComponentModel.ISupportInitialize).EndInit()
|
|
Me.ResumeLayout(False)
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
Private Sub frmSysadminTableSelector_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
Dim i As Integer
|
|
Dim dbconn As New EDOKA.DB_Connection()
|
|
Me.SqlConnection1.ConnectionString = Globals.sConnectionString
|
|
Me.SqlConnection1.Open()
|
|
Me.SqlDataAdapter1.Fill(Me.DataSet1)
|
|
For i = 0 To Me.DataSet1.Tables(0).Rows.Count - 1
|
|
Me.ListBox1.Items.Add(Me.DataSet1.Tables(0).Rows(i)(0))
|
|
Next
|
|
Me.SqlConnection1.Close()
|
|
End Sub
|
|
|
|
Private Sub listbox1_dblclick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
|
|
Close()
|
|
End Sub
|
|
|
|
Public Function get_tablename() As String
|
|
get_tablename = ""
|
|
Me.ShowDialog()
|
|
Return Me.ListBox1.SelectedItem
|
|
End Function
|
|
End Class
|