• 大小: 1.71MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-15
  • 语言: C#
  • 标签: c#  sqlserver  sqlite  

资源简介

可以将SQLServer数据库完整转换为SQLite数据库,包括表结构、视图、数据

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using TEFFY.Common.DbAccess;
using System.Windows.Forms;

namespace SqlserverToSQLite
{
    public class DatabaseConvert
    {

        public static bool CreateSQLiteDatabase(string sqlConnString string sqlitePath string password bool createTriggers bool copyData)
        {
            bool ret = false;

            //this.Cursor = Cursors.WaitCursor;
            SqlConversionHandler handler = new SqlConversionHandler(delegate(bool done
                bool success int percent string msg)
            {
                if (done)
                {
                    ret = success;
                }

                //Invoke(new MethodInvoker(delegate()
                //{
                //    UpdateSensitivity();
                //    lblMessage.Text = msg;
                //    pbrProgress.Value = percent;

                //    if (done)
                //    {
                //        btnStart.Enabled = true;
                //        this.Cursor = Cursors.Default;
                //        UpdateSensitivity();

                //        if (success)
                //        {
                //            MessageBox.Show(this
                //                msg
                //                “Conversion Finished“
                //                MessageBoxButtons.OK
                //                MessageBoxIcon.Information);
                //            pbrProgress.Value = 0;
                //            lblMessage.Text = string.Empty;
                //        }
                //        else
                //        {
                //            if (!_shouldExit)
                //            {
                //                MessageBox.Show(this
                //                    msg
                //                    “Conversion Failed“
                //                    MessageBoxButtons.OK
                //                    MessageBoxIcon.Error);
                //                pbrProgress.Value = 0;
                //                lblMessage.Text = string.Empty;
                //            }
                //            else
                //                Application.Exit();
                //        }
                //    }
                //}));
            });
            SqlTableSelectionHandler selectionHandler = new SqlTableSelectionHandler(delegate(List schema)
            {
                List updated = null;
                //Invoke(new MethodInvoker(delegate
                //{
                //    // Allow the user to select which tables to include by showing him the 
                //    // table selection dialog.
                //    TableSelectionDialog dlg = new TableSelectionDialog();
                //    DialogResult res = dlg.ShowTables(schema this);
                //    if (res == DialogResu

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2923  2011-06-09 23:41  SqlserverToSQLite\WindowsApplication1\App.config

     文件      11776  2011-05-20 11:15  SqlserverToSQLite\WindowsApplication1\AxInterop.MSCommLib.dll

     文件        221  2014-01-20 00:34  SqlserverToSQLite\WindowsApplication1\bin\Debug\dbsetting.xml

     文件     270336  2009-05-17 20:04  SqlserverToSQLite\WindowsApplication1\bin\Debug\log4net.dll

     文件     102400  2014-01-19 18:22  SqlserverToSQLite\WindowsApplication1\bin\Debug\SqlserverToSQLite.exe

     文件       2923  2011-06-09 23:41  SqlserverToSQLite\WindowsApplication1\bin\Debug\SqlserverToSQLite.exe.config

     文件      75264  2014-01-19 18:22  SqlserverToSQLite\WindowsApplication1\bin\Debug\SqlserverToSQLite.pdb

     文件       5632  2014-03-02 22:11  SqlserverToSQLite\WindowsApplication1\bin\Debug\SqlserverToSQLite.vshost.exe

     文件       2923  2011-06-09 23:41  SqlserverToSQLite\WindowsApplication1\bin\Debug\SqlserverToSQLite.vshost.exe.config

     文件    1521664  2012-12-31 01:29  SqlserverToSQLite\WindowsApplication1\bin\Debug\System.Data.SQLite.dll

     文件       7729  2014-01-20 00:34  SqlserverToSQLite\WindowsApplication1\bin\Debug\_log.txt

     文件     270336  2009-05-17 20:04  SqlserverToSQLite\WindowsApplication1\bin\Release\log4net.dll

     文件      98304  2014-03-02 22:12  SqlserverToSQLite\WindowsApplication1\bin\Release\SqlserverToSQLite.exe

     文件       2923  2011-06-09 23:41  SqlserverToSQLite\WindowsApplication1\bin\Release\SqlserverToSQLite.exe.config

     文件      67072  2014-03-02 22:12  SqlserverToSQLite\WindowsApplication1\bin\Release\SqlserverToSQLite.pdb

     文件    1521664  2012-12-31 01:29  SqlserverToSQLite\WindowsApplication1\bin\Release\System.Data.SQLite.dll

     文件       4166  2011-06-09 23:37  SqlserverToSQLite\WindowsApplication1\DatabaseConvert.cs

     文件        508  2010-06-10 19:04  SqlserverToSQLite\WindowsApplication1\DbAccess\ColumnSchema.cs

     文件        375  2010-06-10 19:05  SqlserverToSQLite\WindowsApplication1\DbAccess\DatabaseSchema.cs

     文件        393  2010-06-10 19:05  SqlserverToSQLite\WindowsApplication1\DbAccess\ForeignKeySchema.cs

     文件        382  2010-06-10 19:05  SqlserverToSQLite\WindowsApplication1\DbAccess\IndexSchema.cs

     文件      58536  2011-06-09 23:13  SqlserverToSQLite\WindowsApplication1\DbAccess\SqlServerToSQLite.cs

     文件        419  2010-06-10 19:05  SqlserverToSQLite\WindowsApplication1\DbAccess\TableSchema.cs

     文件       4330  2010-06-10 19:06  SqlserverToSQLite\WindowsApplication1\DbAccess\TriggerBuilder.cs

     文件        488  2010-06-10 19:06  SqlserverToSQLite\WindowsApplication1\DbAccess\TriggerSchema.cs

     文件        475  2010-06-10 19:06  SqlserverToSQLite\WindowsApplication1\DbAccess\ViewSchema.cs

    ..A.SHR       358  2011-02-22 16:55  SqlserverToSQLite\WindowsApplication1\DbAccess\vssver2.scc

     文件       3277  2014-03-02 22:12  SqlserverToSQLite\WindowsApplication1\Form1.cs

     文件       7944  2011-06-09 23:44  SqlserverToSQLite\WindowsApplication1\Form1.Designer.cs

     文件       5814  2011-06-09 23:44  SqlserverToSQLite\WindowsApplication1\Form1.resx

............此处省略52个文件信息

评论

共有 条评论