
22/11/2011, 19:21
|
| | Fecha de Ingreso: junio-2011
Mensajes: 329
Antigüedad: 13 años, 8 meses Puntos: 2 | |
enviar valor a textbox como le puedo hacer para enviar el resultado de este codigo a un texbox..?..actualmente me lo envia a un grid..pero necesito q se vaya a un textbox..saludos..
Protected Sub Button9_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button9.Click
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
Dim suborden As String
MyConnection = New SqlConnection("Data Source=DELL;Initial Catalog=compras;Persist Security Info=True;User ID=sa;Password=3845")
For i As Integer = 0 To ListBox1.Items.Count - 1
MyCommand = New SqlDataAdapter("SELECT top 1 [line] FROM [compras] where onum= '" & suborden & "' ", MyConnection)
suborden = ListBox1.Items(i).ToString
DS = New DataSet()
MyCommand.Fill(DS, "compras") ---------------------------------------aqui lo envia al grid
GridView2.DataSource = DS.Tables("compras").DefaultView
GridView2.DataBind()
Next i
MyConnection.Close()
End Sub |