Código:
cmd = New MySqlCommand("Select a.nombre as cenote, d.nombre as restaurante, c.costo_minimo from cenotes as a, localidades as b, costo_restaurante as c, restaurantes as d where b.ID_localidad=a.localidad AND c.Id_cenotes=a.Id_cenote AND c.id_restaurante=d.Id_restaurante AND c.Id_cenotes=" & Yucatan.idcenote, conexion.Mysqlcon)
restaurantes = New MySqlDataAdapter(cmd)
restaurante = New DataSet()
Dim lectura As MySqlDataReader
Try
conexion.iniciar()
conexion.Mysqlcon.Open()
cmd.Connection = conexion.Mysqlcon
lectura = cmd.ExecuteReader
lectura.Read()
Dim CostoMi As Decimal
Dim CostoMa As Decimal
CostoMi = lectura(3).ToString
CostoMa = lectura(4).ToString
TextBox7.Text = Format(CostoMi, "$ ###.####")
TextBox10.Text = Format(CostoMa, "$ ###.####")
Catch ex As Exception
MsgBox(ex.Message)
Finally
conexion.Mysqlcon.Close()
End Try
'cerrar despues de llenado'
conexion.Mysqlcon.Close()
restaurantes.Fill(restaurante, "nombre")
Dim Tabla As DataTable
Tabla = restaurante.Tables("nombre")
Dim Fila As DataRow
For Each Fila In Tabla.Rows
Combo.Items.Add(Fila.Item("restaurante"))
Next
restaurantes = New MySqlDataAdapter(cmd)
restaurante = New DataSet()
Dim lectura As MySqlDataReader
Try
conexion.iniciar()
conexion.Mysqlcon.Open()
cmd.Connection = conexion.Mysqlcon
lectura = cmd.ExecuteReader
lectura.Read()
Dim CostoMi As Decimal
Dim CostoMa As Decimal
CostoMi = lectura(3).ToString
CostoMa = lectura(4).ToString
TextBox7.Text = Format(CostoMi, "$ ###.####")
TextBox10.Text = Format(CostoMa, "$ ###.####")
Catch ex As Exception
MsgBox(ex.Message)
Finally
conexion.Mysqlcon.Close()
End Try
'cerrar despues de llenado'
conexion.Mysqlcon.Close()
restaurantes.Fill(restaurante, "nombre")
Dim Tabla As DataTable
Tabla = restaurante.Tables("nombre")
Dim Fila As DataRow
For Each Fila In Tabla.Rows
Combo.Items.Add(Fila.Item("restaurante"))
Next
Y cada vez que entro a la tabla me sale el mensaje de "Indicefuera de los limites de la matriz" y si me aparece el nombre del restaurante...
No se que pueda ser me podrian ayudar :/ =?