Foros del Web » Programación para mayores de 30 ;) » .NET »

Duda con funcion desde un datagridvie

Estas en el tema de Duda con funcion desde un datagridvie en el foro de .NET en Foros del Web. Buen día, Tengo el sieguiente codigo en mi formulario @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código vb: Ver original For Each f As DataRow In ds41.Tables(0).Rows       ...
  #1 (permalink)  
Antiguo 17/12/2013, 08:03
Avatar de yamiblancoc  
Fecha de Ingreso: agosto-2011
Mensajes: 103
Antigüedad: 12 años, 8 meses
Puntos: 4
Sonrisa Duda con funcion desde un datagridvie

Buen día,

Tengo el sieguiente codigo en mi formulario

Código vb:
Ver original
  1. For Each f As DataRow In ds41.Tables(0).Rows
  2.                     DataGridView1.Rows.Add(f(0).ToString(), f(1).ToString(), _
  3. f(2).ToString(), f(3).ToString(), f(4).ToString(), f(5).ToString(), f(6).ToString(), f(7).ToString(), _
  4. f(8).ToString(), f(9).ToString, f(10).ToString, f(11).ToString, _
  5. comentarioTIENDA(f(2).ToString()), comentarioCP(f(4).ToString(), f(2).ToString()),_
  6.  comentarioITEM(f(6).ToString(), f(2).ToString()))
  7.                     ProgressBar1.Value = ProgressBar1.Value + 1
  8.                     Application.DoEvents()
  9.                 Next


y tengo estas funciones en mi modulo

Código vb:
Ver original
  1. Public Function comentarioTIENDA(ByVal TIENDA As String) As String
  2.  
  3.         Dim tbl2 As DataTable
  4.  
  5.         tbl2 = Tabla2("SELECT descome FROM COM" & validador.cbbperiod.Text & " where CODCP=" & TIENDA)
  6.  
  7.         Return tbl2.Rows(0)("descome").ToString() = "SIN COMENTARIOS"
  8.  
  9.     End Function
  10.  
  11.     Public Function comentarioCP(ByVal CP As String, ByVal tienda As String) As String
  12.  
  13.         Dim tbl2 As DataTable
  14.  
  15.         tbl2 = Tabla2("SELECT descome FROM COM" & validador.cbbperiod.Text & " where codloj=" & CP & " and codloj=" & tienda)
  16.  
  17.             Return tbl2.Rows(0)("descome").ToString() = "SIN COMENTARIOS"
  18.  
  19.     End Function
  20.  
  21.     Public Function comentarioITEM(ByVal ITEM As String, ByVal tienda As String) As String
  22.  
  23.         Dim tbl2 As DataTable
  24.  
  25.         tbl2 = Tabla2("SELECT descome FROM COM" & validador.cbbperiod.Text & " where codITE=" & ITEM & " and codloj=" & tienda)
  26.         If tbl2.Rows.Count = 0 Then
  27.             Console.Write("Sin Comentarios")
  28.         Else
  29.  
  30.             Return tbl2.Rows(0)("descome").ToString
  31.  
  32.         End If
  33.  
  34.  
  35.     End Function

Se supone que en en mi codigo llamo a las funciones para llenar unas celdas en mi datagridview pero no entiendo porque solo me toma la ultima funcion "comentarioItem" y no recorre las funciones "ComentarioTienda" y "comentariocp"

Alguien me podra ayudar!?





Gracias!!

Etiquetas: datagridview, funciones, vb
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:00.