Click here to Skip to main content
6,594,432 members and growing! (15,722 online)
Email Password   helpLost your password?
Database » Database » SQL Server License: The Code Project Open License (CPOL)

Table Data Exporter

By Igor Krupitsky

The Table Data Exporter creates a SQL script for data in a table.
VB, .NET, SQL Server, VS.NET2003
Version:2 (See All)
Posted:24 Jan 2008
Updated:24 Jan 2008
Views:8,666
Bookmarked:18 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
6 votes for this article.
Popularity: 3.54 Rating: 4.56 out of 5
1 vote, 16.7%
1

2

3
1 vote, 16.7%
4
4 votes, 66.7%
5

ExportTable

Introduction

This application will let you script table data into a file. It will create an INSERT statement for each row in your table.

Using the code

The application is written in Visual Studio 2003, and has been tested with SQL Server only. Potentially, the application can work with other databases.

The application uses the DataLink object to connect to the database:

Protected Function EditConnectionString(ByVal sConnectionString As String)
    Try
        Dim oDataLinks As Object = CreateObject("DataLinks")
        Dim cn As Object = CreateObject("ADODB.Connection")
        cn.ConnectionString = sConnectionString
        oDataLinks.hWnd = Me.Handle

        If Not oDataLinks.PromptEdit(cn) Then
            'User pressed cancel button
            Return ""
        End If

        cn.Open()
        Return cn.ConnectionString
    Catch ex As Exception
        MsgBox(ex.Message)
        Return ""
    End Try
End Function

License

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

About the Author

Igor Krupitsky


Member
Igor is a business intelligence consultant working in Tampa, Florida. He has a BS in Finance from University of South Carolina and Masters in Information Management System from University of South Florida. He also has following professional certifications: MCSD, MCDBA, MCAD.
Occupation: Web Developer
Location: United States United States

Other popular Database articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 4 of 4 (Total in Forum: 4) (Refresh)FirstPrevNext
GeneralHow to disable the provider PinmemberBenosn Tan17:31 29 Jan '08  
QuestionRe: How to disable the provider PinmemberIgor Krupitsky13:03 31 Jan '08  
GeneralWorked great for me with SQL 2000 PinmemberG James15:05 28 Jan '08  
GeneralRe: Worked great for me with SQL 2000 PinmemberJosh Blair12:29 29 Jan '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 24 Jan 2008
Editor: Smitha Vijayan
Copyright 2008 by Igor Krupitsky
Everything else Copyright © CodeProject, 1999-2009
Web21 | Advertise on the Code Project