|
-
Jun 22nd, 2005, 10:22 AM
#1
Thread Starter
Junior Member
Data row
Would someone please point out my problem here, and supply the correct code.
=============I think i messed up around the for each statement================
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cnn As New SqlConnection("Data Source=DESKTOP; Initial Catalog=Northwind; Trusted_Connection=yes")
cnn.Open()
Dim da As New SqlDataAdapter("Select * From Customers", cnn)
Dim ds As New DataSet
da.Fill(ds, "Customers")
Dim dr As DataRow
For Each dr In ds.Tables.Item("Customers").Rows
ListBox1.DataSource = dr
ListBox1.DataBind()
Next
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|