Cita:
Iniciado por luisito1
hola genios de la programacion, les comento mi problema que tal vez sea tonto pero bueno soy muy nuevo en esto por eso acudo a ustedes que mas saben.. bueno mi problema deriba en que tengo una tabla personal donde guardo todos los datos como nombre apellido titulo etc, y mi problema es que alguno de los campos pueden ser nulos pero puede ser cualquiera.. y cuando yo quiero mostrar los datos me tiene que tirar el valor de cada uno, y en caso de que sea nulo me gustaria que en el label que no trae valor que aparezca el texto " falta de ingresar" les dejo el codigo asi me ayudan como puedo poner.. muchas gracias por su tiempo y por cooperar con mi tesis asi me recibo
podria ser:
Código:
For Each i As DataRow In dstper.Tables("tpersonal").Rows
If i.Item(0).ToString & "" <> "" Then
lblLeg.Text = i.Item(0).ToString
Else
lblLeg.Text = "Falta ingresar"
End If
If i.Item(2).ToString & "" <> "" Then
lblNombre.Text = i.Item(2).ToString
Else
lblNombre.Text = "Falta ingresar"
End If
If i.Item(1).ToString & "" <> "" Then
lblApellido.Text = i.Item(1).ToString
Else
lblApellido.Text = "Falta ingresar"
End If
If i.Item(8).ToString & "" <> "" Then
lblBarrio.Text = i.Item(8).ToString
Else
lblBarrio.Text = "Falta ingresar"
End If
If i.Item(9).ToString & "" <> "" Then
lblCalle.Text = i.Item(9).ToString
Else
lblCalle.Text = "Falta ingresar"
End If
If i.Item(10).ToString & "" <> "" Then
lblNro.Text = i.Item(10).ToString
Else
lblNro.Text = "Falta ingresar"
End If
If i.Item(11).ToString & "" <> "" Then
lblTE.Text = i.Item(11).ToString
Else
lblTE.Text = "Falta ingresar"
End If
If i.Item(12).ToString & "" <> "" Then
lblCel.Text = i.Item(12).ToString
Else
lblCel.Text = "Falta ingresar"
End If
If i.Item(13).ToString & "" <> "" Then
lblEmail.Text = i.Item(13).ToString
Else
lblEmail.Text = "Falta ingresar"
End If
If i.Item(14).ToString & "" <> "" Then
lblTitulo.Text = i.Item(14).ToString
Else
lblTitulo.Text = "Falta ingresar"
End If
Next
jeje nose si exista uno mas rapido pero este se me ocurrio
Saludos