⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 converter.cs

📁 可以实现任意数据库之间的数据互导,可以实现任意数据库之间的数据互导
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using LC_XMLControl;
using System.Collections;
using System.Data.OleDb;
using System.Windows.Forms;

namespace MySqlToXml
{
    public class Converter:IThransProtocol
    {

        #region IThransProtocol 成员

        private ArrayList _allres=new ArrayList();
        public System.Collections.ArrayList allres
        {
            get
            {
                return _allres;
            }
            set
            {
                _allres = (ArrayList)value;
            }
        }

        public void closeDesConnection()
        {
            
        }

        public void closeSourceConnection()
        {
            
        }

        public void createDesContentction(string constr)
        {
            //"Driver={mySQL};Server=data.domain.com;Port=3306;Option=131072;Stmt=;Database=my-database;Uid=username;Pwd=password;" 
        }

        public void createSourceContenction(string constr)
        {
            _sourceconnection = null;
            if (_sourceconnection != null) _sourceconnection.Close();
            string[] temp = constr.Split('#');
            string cstr = "";
            int k = 0;
            if (temp.Length > 0)
            {
                for (int i = 0; i < temp.Length; i++)
                {
                    if (temp[i].Trim().ToString() != "")
                    {

                        temp[k++] = temp[i];
                    }
                }
            }
            //cstr = "Driver={mySQL};Server="+temp[0]+";Port="+3360+";Database="+temp[1]+";Uid="+temp[2]+";Pwd="+temp[3]+";";
            //cstr = "Provider=MySQLProv;Data Source=mydb;User Id=UserName;Password=asdasd;";
            try
            {
                _sourceconnection = new OleDbConnection(cstr);
                _sourceconnection.Open();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message.ToString());
            }


        }
        private int _cursum;
        public int cursum
        {
            get
            {
                return _cursum;
            }
            set
            {
                _cursum = value;
            }
        }
        private OleDbConnection _desconnection;
        public object desconnection
        {
            
            get
            {
                return _desconnection; ;
            }
            set
            {
                _desconnection = (OleDbConnection)value;
            }
        }
        private int _dtype;
        public int dtype
        {
            get
            {
                return _dtype;
            }
            set
            {
                _dtype = value;
            }
        }

        private ArrayList _erorres = new ArrayList();
        public System.Collections.ArrayList errorres
        {
            get
            {
                return _erorres;
            }
            set
            {
                _erorres = (ArrayList)value;
            }
        }

        public System.Collections.ArrayList getAllDesField(string table)
        {
            return null;
        }

        public System.Collections.ArrayList getAllDesTable()
        {
            return null;
        }

        public System.Collections.ArrayList getAllSourceField(string table)
        {
            return null;
        }

        public System.Collections.ArrayList getAllSourceTable()
        {
            return null;
        }
        private string _info;
        public string info
        {
            get
            {
                return _info;
            }
            set
            {
                _info = value;
            }
        }
        private ArrayList _msg = new ArrayList();
        public System.Collections.ArrayList msg
        {
            get
            {
                return _msg;
            }
            set
            {
                _msg = (ArrayList)value;
            }
        }

        public System.Data.DataTable sourceToXml(string source, System.Collections.ArrayList allfield)
        {
            return null;
        }

        private OleDbConnection _sourceconnection;
        public object sourceconnection
        {
            get
            {
                return _sourceconnection;
            }
            set
            {
                _sourceconnection = (OleDbConnection)value;
            }
        }
        private string _spliter;
        public string spliter
        {
            get
            {
                return _spliter;
            }
            set
            {
                _spliter = value;
            }
        }
        private int _stype;
        public int stype
        {
            get
            {
                return _stype;
            }
            set
            {
                _stype = value;
            }
        }

        public void xmlToDes(string des, System.Collections.ArrayList rows, System.Collections.ArrayList field)
        {
            
        }

        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -