Dataset Iteration

G

Guest

How do I iterate through a dataset and add the rows to a word document? I
have the following:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim oApp = New Word.Application
Dim oMainDoc = oApp.ActiveDocument
Dim Cust_id As String
Cust_id = "select * from filename where Customer_id=2"
Me.MySqlConnection1.Open()
Me.MySqlCommand1.CommandText = Cust_id
Me.MySqlDataAdapter1.Fill(DataSet31)
Dim oPara1 = oMainDoc.Content.Paragraphs.Add
Dim drDetails As DataRow
For Each drDetails In DataSet3
oPara1 = oPara1 & drDetails.GetParentRows
Next
Me.MySqlConnection1.Close()

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top