Mit dem Code weiter unten kann ich wunderbar GridVews befüllen.
Ich nöchte mit genau diesem Code aber kein Data Table erzeugen, sonder den Wert oder die Werte meiner Abfrage in definierte TextBoxen Schreiben.
Meine Abfrage such ja eh nur nach einem eintrag mit einer gewissen Id.
Hat jemand einen Tip für mich ?
Dankeschön und gute Nacht
mycmd.Connection = myconnection.open
mycmd.CommandText = "SELECT * From auftraggeber Where Id=" & TextBox13.Text
datapter = New MySqlDataAdapter(mycmd)
dtable.Rows.Clear()
datapter.Fill(dtable)
If Not dtable Is Nothing AndAlso dtable.Rows.Count > 0 Then
DataGridView1.AutoGenerateColumns = False
DataGridView1.DataSource = dtable
DataGridView1.Columns(0).DataPropertyName = "Id"
DataGridView1.Columns(1).DataPropertyName = "Standorte"
DataGridView1.Columns(2).DataPropertyName = "Auftraggeber"
DataGridView1.Columns(3).DataPropertyName = "Info1"
DataGridView1.Columns(4).DataPropertyName = "Info2"
DataGridView1.Columns(5).DataPropertyName = "Info3"
DataGridView1.Columns(6).DataPropertyName = "Strasse"
DataGridView1.Columns(7).DataPropertyName = "PLZ"
DataGridView1.Columns(8).DataPropertyName = "Ort"
DataGridView1.Columns(9).DataPropertyName = "Zusatz1"
DataGridView1.Columns(10).DataPropertyName = "Zusatz2"
DataGridView1.Columns(11).DataPropertyName = "Zusatz3"
DataGridView1.Columns(12).DataPropertyName = "Kommentar"
End If
myconnection.close()