예제 #1
0
 public MySqlHelper(SqlInfo sqlInfo)
 {
     con = new MySqlConnection();
     con.ConnectionString = string.Format("server={0};port={1};user id={2};password={3};database={4};",
                                          sqlInfo.Server,
                                          sqlInfo.Port,
                                          sqlInfo.UserId,
                                          sqlInfo.Password,
                                          sqlInfo.Database);
 }
예제 #2
0
        /// <summary>
        /// 根据提供的 sqlInfo 生成一个连接数据库的 ISqlHelper
        /// </summary>
        /// <param name="sqlInfo"></param>
        /// <returns></returns>
        public static ISqlHelper Create(SqlInfo sqlInfo)
        {
            switch (sqlInfo.SqlType)
            {
            case SqlType.MSSQL: return(new MsSqlHelper(sqlInfo));

            case SqlType.MYSQL: return(new MySqlHelper(sqlInfo));

            default: return(new MySqlHelper(sqlInfo));
            }
        }
예제 #3
0
 public MsSqlHelper(SqlInfo sqlinfo)
 {
     int i = 0;
 }