views:

25

answers:

1

How do I print the ms access data(.mdb) in vb.net? Here is the code that I'm using to view the data in the form. What I want to do is to be able to print what is currently being viewed. Perhaps automatically save the .pdf file and the pdf viewer installed on the system will open that newly generated pdf file

Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\search.mdb")
            Dim cmd As OleDbCommand = New OleDbCommand("Select * from GH where NAME= '" & TextBox6.Text & "' ", cn)

            cn.Open()

            Dim rdr As OleDbDataReader
            rdr = cmd.ExecuteReader




            If rdr.HasRows Then
                rdr.Read()
                NoAcc = rdr("NAME")
                If (TextBox6.Text = NoAcc) Then TextBox1.Text = rdr("IDNUMBER")
                If (TextBox6.Text = NoAcc) Then TextBox7.Text = rdr("DEPARTMENT")
                If (TextBox6.Text = NoAcc) Then TextBox8.Text = rdr("COURSE")

            End If

-some sites for beginners regarding this topic would help a lot:)

+1  A: 

I would suggest you to use DataGrid controls and directly pass the data source to it.

coder