Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/11/2009, 14:45
Giufantasy
 
Fecha de Ingreso: octubre-2009
Mensajes: 63
Antigüedad: 15 años, 4 meses
Puntos: 0
Recuperar NOmbre por ID

Estimados:

estoy haciendo una funcion para rescatar el nombre de una empresa por su id
el id es un string y el nombre igual
Estoy trabajando en vb.net con sqlserver2000

¿Que estoy haciendo mal?

Public Function getRecuperarNombrePorIdEmpresa(ByVal id As String) As String
Dim val As String = New String("")
Me.configurarConexion()
cnn.setNombreTabla("EMPRESA_PULLMAN")
cnn.setCadenaSQL("Select NOMBRE from EMPRESA_PULLMAN Where empresa = '" & id & "'")
cnn.setEsSelect(True)
cnn.conectar()
For Each dr As System.Data.DataRow In cnn.getDbDataSet.Tables(cnn.getNombreTabla()).Rows
val = (dr(0))
Next
Return val
End Function

y no me retorna nada