Hallo ich habe ein Problem ich möchte wenn in Textbox2 kein Text ist das er ein Text mit : sendet ist aber in Textbox2 ein Text dann soll er den Befehl machen
Info :
Info :
VB.NET-Quellcode
- If TextBox2.Text = Text Then
- Dim myconnectionstring As String = ""
- If myconnectionstring = "" Then
- myconnectionstring = "server=ip;" & "user id=un;" & "password=pw;" & "database=db"
- End If
- Dim myConnection As New MySqlConnection(myconnectionstring)
- Dim myInsertQuery As String
- myInsertQuery = "UPDATE einsatz SET einsatz = REPLACE('*','*', '" & TextBox1.Text & "')"
- Dim myCommand As New MySqlCommand(myInsertQuery)
- myCommand.Connection = myConnection
- myConnection.Open()
- myCommand.ExecuteNonQuery()
- myConnection.Close()
- ElseIf Not TextBox2.SelectedText Then
- Dim myconnectionstring As String = ""
- If myconnectionstring = "" Then
- myconnectionstring = "server=ip;" & "user id=un;" & "password=pw;" & "database=db"
- End If
- Dim myConnection As New MySqlConnection(myconnectionstring)
- Dim myInsertQuery As String
- myInsertQuery = "INSERT INTO einsatz (einsatz) Values('" & TextBox1.Text & "')"
- Dim myCommand As New MySqlCommand(myInsertQuery)
- myCommand.Connection = myConnection
- myConnection.Open()
- myCommand.ExecuteNonQuery()
- End If
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Kevin“ () aus folgendem Grund: Thema Gelöst