Wenn ich DataListName.DataBind() eingebe:
Protected Sub idRegion_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim strConnString As [String] = ConfigurationManager.ConnectionStrings("conString").ConnectionString
Dim strQuery As [String] = "Select * from Campingplatz where idLand =@LandID and idBundesland = @BundeslandID and idRegion = @RegionID ORDER BY Name ASC"
Dim con As New MySqlConnection(strConnString)
Dim cmd As New MySqlCommand()
cmd.Parameters.AddWithValue("@LandID", MySqlDbType.Decimal).Value = DropDownLand.SelectedItem.Value
cmd.Parameters.AddWithValue("@BundeslandID", MySqlDbType.Decimal).Value = DropDownBundesland.SelectedItem.Value
cmd.Parameters.AddWithValue("@RegionID", MySqlDbType.Decimal).Value = DropDownRegion.SelectedItem.Value
cmd.CommandType = CommandType.Text
cmd.CommandText = strQuery
cmd.Connection = con
Try
con.Open()
DataListName.DataSource = cmd.ExecuteReader()
**DataListName.DataBind()**
Catch ex As Exception
'Throw ex
Finally
con.Close()
con.Dispose()
End Try
End Sub
macht er mir die Tabelle kaputt. Wie verhindere ich das?