By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

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

"anoop" <an***@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.com...
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
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.