
problema con declaración de variable
Publicado por anonymous (99 intervenciones) el 31/08/2017 17:33:49
Hola amigos: tengo un problema con la variable DataSet (ds), condiciono un label a tomar el grado u otro, en cada condición declaro la variable ds pero al salir de dicho condicionamiento y usar ds, me previene un error: variable no declarada, puede que esté inaccesible...
alguien me da una ayudadita? GRACIAS!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ElseIf Label6.Text = "2° A" Or Label6.Text = "2° B" Or Label6.Text = "2° C" Or Label6.Text = "2° D" Or Label6.Text = "3° A" Or Label6.Text = "3° B" Or Label6.Text = "3° C" Or Label6.Text = "3° D" Then
If Label6.Text = "2° A" Or Label6.Text = "2° B" Or Label6.Text = "2° C" Or Label6.Text = "2° D" Then
Dim da As New OleDbDataAdapter("SELECT * FROM segundo WHERE nombre = '" + nom + "'", conexion)
Dim ds As New DataSet
da.Fill(ds)
ElseIf Label6.Text = "3° A" Or Label6.Text = "3° B" Or Label6.Text = "3° C" Or Label6.Text = "3° D" Then
Dim da As New OleDbDataAdapter("SELECT * FROM tercero WHERE nombre = '" + nom + "'", conexion)
Dim ds As New DataSet
da.Fill(ds)
End If
Documento = MSWord.Documents.Open("C:\plantillas\Constancia_eval2y3.docx")
Dim nombre As String
For Each row As DataRow In ds.Tables(0).Rows ''''aqui dice que necesito declarar la variable
nombre = row.Item("nombre").ToString()
For x = 1 To 5
If (Val(row.Item(asig2(0) & x))) = 0 Then
If (Val(row.Item(asig2(0) & 1))) = 0 Then
MsgBox("Aún no existen evaluaciones para el alumno(a).... CONSTANCIA CANCELADA")
conexion.Close()
Documento.Close(Word.WdSaveOptions.wdDoNotSaveChanges)
Exit Sub
End If
Exit For
End If
alguien me da una ayudadita? GRACIAS!
Valora esta pregunta


0