Ver Mensaje Individual
  #11 (permalink)  
Antiguo 05/07/2012, 13:00
Avatar de stuart_david3
stuart_david3
 
Fecha de Ingreso: agosto-2011
Mensajes: 215
Antigüedad: 12 años, 8 meses
Puntos: 1
Respuesta: Poner varios links para mostrar diferentes campos de una base de datos!

Ok te mando el código del script que recibe:

Código ASP:
Ver original
  1. Imports System.Data
  2. Imports System.Data.SqlClient
  3. Partial Class ConfirmarFunc15
  4.     Inherits System.Web.UI.Page
  5.  
  6.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  7.         Dim reader As SqlDataReader
  8.         Dim values As ArrayList = New ArrayList()
  9.         Dim conn As SqlConnection = New SqlConnection("server=myhost;database=mydb;User ID=myuser;Password=mypass;Trusted_Connection=no")
  10.         Dim Answer As String = Session("funcionario_en_revision").ToString()
  11.         TextBox1.Text = Answer
  12.         Dim sql2 As String = "SELECT id, control, rpe, nombre, fechaant, escolaridad, ingreso, numplazaant, puestoant, claveant, adscripant, goant, ndant, cecoant, salarioant, deant, aant, numplazaact, puestoact, claveact, adscripact, goact, ndact, cecoact, salarioact, deact, aact, motivado, funcionario_en_revision, status1, status15, status2, status25, status3 FROM Reemplazos3 WHERE funcionario_en_revision='[email protected]"
  13.         Dim dr As New SqlCommand(sql2, conn)
  14.         conn.Open()
  15.         reader = dr.ExecuteReader()
  16.         If reader.Read() Then
  17.             Dim fecha = DateTime.Now
  18.             Text_rpe.Text = CStr(reader("rpe")).ToString
  19.             Text_Folio.Text = CStr(reader("control")).ToString
  20.             Text_nombre.Text = CStr(reader("nombre")).ToString
  21.             Text_nombre.Attributes.Add("readonly", "readonly")
  22.             Text_nombre.BackColor = Drawing.Color.Silver
  23.             Text_Feant.Text = CStr(reader("fechaant")).ToString
  24.             Text_Feant.Attributes.Add("readonly", "readonly")
  25.             Text_Feant.BackColor = Drawing.Color.Silver
  26.             Text_Escolar.Text = CStr(reader("escolaridad")).ToString
  27.             Text_Escolar.Attributes.Add("readonly", "readonly")
  28.             Text_Escolar.BackColor = Drawing.Color.Silver
  29.             Text_Ingre2.Text = ("X").ToString
  30.             Else
  31.                 Text_Terc1.Text = CStr(reader("aant"))
  32.                 Text_Terc1.BackColor = Drawing.Color.Silver
  33.                 Text_Terc1.Attributes.Add("readonly", "readonly")
  34.                 Text_Terc2.Text = CStr(reader("aact"))
  35.             End If
  36.             Text_Sal1.Text = CStr(reader("salarioant")).ToString
  37.             Text_Sal1.Attributes.Add("readonly", "readonly")
  38.             Text_Sal1.BackColor = Drawing.Color.Silver
  39.             Text_Clave1.Text = CStr(reader("claveant")).ToString
  40.         Else
  41.             Text_Ingre1.Text = ("X")
  42.             Text_Ingre1.BackColor = Drawing.Color.Silver
  43.             Text_Ingre1.Attributes.Add("readonly", "readonly")
  44.             Text_Ingre2.BackColor = Drawing.Color.Silver
  45.             Text_Ingre2.Attributes.Add("readonly", "readonly")
  46.         End If
  47.         reader.Close()
  48.         conn.Close()
  49.     End Sub
  50. End Class

Hasta ahora lo que estoy intentando es mostrar en el TextBox1 el contenido de session...