
no se puede encontrar la tabla 0
Publicado por Ana (4 intervenciones) el 13/01/2016 18:17:20
Hola buen día, tengo un problema al cargar el form saca el error , espero puedan ayudarme. gracias de ante mano.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Private Sub FAudiencias_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
If Not MSeguridad.bObtenerPermisos(Me.Name, bAdd, bEdit, bDel) Then
Exit Sub
End If
Dim miclase As New Conexion
bloquearaudiencias()
'MUENTRA EL NOMBRE DE USUARIO EN UN LABEL
Dim frm As New IASecure.frmInicio()
Me.Label17.Text = g_sNombreUsuario
LLenarCombo(CBABOGADO, "Oficial_Juridico", "nombreabogado", "IdAbogado")
CBABOGADO.SelectedIndex = -1
'INCREMENTA EL ID EN +1 CUANDO SE AGREGA UNA NUEVA AUDIENCIA
Dim id As Integer = 0
Dim miid As String = ""
miid = miclase.escala("select max(idaudiencias) from audiencias")
If miid = "" Then
id = 1
Else
id = id + Val(miid)
End If
TXTNOAUDIENCIA.Text = id
'PARA EL DATAGRID agenda ---
cargacolumnas()
Dim horas(5) As String
horas(0) = "09:00 AM"
horas(1) = "10:00 AM"
horas(2) = "11:00 AM"
horas(3) = "01:00 PM"
horas(4) = "02:00 PM"
horas(5) = "03:00 PM"
For i As Integer = 0 To horas.Length - 1
Dim ds As New DataSet
ds = miclase.traedataset("SELECT horaaudiencia,fechaaudiencia, IdAbogado From audiencias Where horaaudiencia ='" & horas(i) & "' and fechaaudiencia='" & DTPAUDIENCIA.Text & "' and IdAbogado= " & CBABOGADO.SelectedValue & "")
If ds.Tables(0).Rows.Count > 0 Then
If IsDBNull(ds.Tables(0).Rows(0).Item(0)) Then
Else
Dim filasdg As Integer = ds.Tables(0).Rows.Count
For ii As Integer = 0 To filasdg - 1
DataGridView1(2, i).Value = ds.Tables(0).Rows(ii).Item(1)
Next
End If
End If
Next
cargaralgridview()
DataGridView1.AutoResizeColumns()
DataGridView1.AutoResizeRows()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "DAI - Error")
End Try
End Sub
Valora esta pregunta


0