display data in a text box using the click of a Button in .aspx p

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello,
how can I display data from a Data source such as SQL Server in a
textbox by using the click of a Button on an .aspx page in a Visual Basic
..Net Project . If I have to use a DataSet, then how, please explain step by
step, I am new to .Net. I am using my own database in SQL Server, with all
the tables created.

Thank You
 
Hi,

Try something like this.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim cn As New SqlConnection("server=localhost;" & _

"Integrated Security=SSPI;Initial Catalog=NorthWind")

Dim da As SqlDataAdapter

Dim ds As New DataSet

da = New SqlDataAdapter("Select * from Customers", cn)

ds = New DataSet

da.Fill(ds)

TextBox1.Text = ds.Tables(0).Rows(1).Item("CustomerID").ToString

End Sub



Ken

----------------------

hello,
how can I display data from a Data source such as SQL Server in a
textbox by using the click of a Button on an .aspx page in a Visual Basic
..Net Project . If I have to use a DataSet, then how, please explain step by
step, I am new to .Net. I am using my own database in SQL Server, with all
the tables created.

Thank You
 
Back
Top