Ver Mensaje Individual
  #12 (permalink)  
Antiguo 29/05/2008, 16:39
roger1187
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 9 meses
Puntos: 1
Respuesta: como meter 1 variable en 1 range validator ??

fueron 1 par d pasos ...pero lo use usando 1 storedprocedure
y ahi cree las validaciones

Cita:
sub validacionesautomaticas()

Dim objConnection As SqlConnection
Dim objCommand As SqlCommand
Dim objAdapter As SqlDataAdapter
Dim strSQLQuery As String
dim a1 as integer



' Set up our connection.
objConnection = New SqlConnection("Data Source=(local); Initial Catalog=sigaf; user id=sa; password=sa159")
' Set up our SQL query text.
if request.Form("DdlTipoCredito") = "" then
a1 = 1
else
a1 = request.Form("DdlTipoCredito")
end if
strSQLQuery = "select nTipoCredito,cDescripcion,nNumBancosEndeuda,nAñoFa brica,nLimiteEndeuda from tipocredito where nTipoCredito =" & a1
' Create new command object passing it our SQL query
' and telling it which connection to use.
'
objCommand = New SqlCommand(strSQLQuery, objConnection)
'abrimos la conexion
objConnection.open()
Dim rs As SqlDataReader = objCommand.ExecuteReader
rs.read
nNumBancosEndeuda = rs("nNumBancosEndeuda")
AnoFabrica = rs("nAñoFabrica")
nLimiteEndeuda = rs("nLimiteEndeuda")
rgvNBancos.MaximumValue = nNumBancosEndeuda
rgvAnoFabri.MaximumValue = AnoFabrica
rgvTotEndeuda.MaximumValue = nLimiteEndeuda
objConnection.Close()
end sub