Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me sir...


thank you
praveen
Posted
Comments
[no name] 16-Nov-12 1:43am    
Not getting your question...

 
Share this answer
 
I would select everything from the table and use a stream writer to export it to csv

VB
        Dim cn As New OleDbConnection
        Dim qry As String = "SELECT * FROM YOURTABLE"
        Dim myReader As OleDbDataReader
Dim myWriter As New StreamWriter(DIRECTORY AND NAME OF THE FILE)

        Try

            cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & PATH TO YOUR TABLE& ";Persist Security Info=True"

            cn.Open()

            Using cmd As New OleDbCommand(qry, cn)

                myReader = cmd.ExecuteReader()
                myWriter.Writeline(ALL YOU HEADERS SEPERATED BY COMMAS)
                While myReader.Read()
                    string line = myReader(FIELD IN YOUR TABLE) +
                    "," + myReader(FIELD IN YOUR TABLE)

                    myWriter.Writeline(line)
                End While

            End Using

            myReader.Close()

            cn.Close()
        Catch ex As Exception
       
        End Try


is this what you meant?
 
Share this answer
 
v4
Comments
[no name] 18-Nov-12 23:21pm    
he needs c#, not vb.net

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900