Click here to Skip to main content
15,884,177 members
Articles / Database Development / SQL Server

.NET Installer that Automatically Installs SQL 2005 Express

Rate me:
Please Sign up or sign in to vote.
4.77/5 (23 votes)
28 Jul 2008GPL35 min read 153.4K   6.2K   133  
This project enables developer to create a setup package that automatically installs SQL 2005 Express and restores database to it
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JohnKenedy.DataAccessModule.Modules
{
    [Serializable]
    public class SortAbleModuleExtend : ModuleExtendDefinition
    {
        public SortAbleModuleExtend()
        {
            _ModuleName = "SortAbleModuleExtend";
            _RolenameAndTable.Add(new KeyValuePair<string, string>("TableToSort", ""));
            _Notes = "This module enable table sorting, enable rows ordering, to move up or move down a row by calling method generated by this code.";
            _Tags = "Functionality";
            _ParameterNameAndValue.Add(new KeyValuePair<string, string>("TablePrimaryKey", ""));
            _ParameterNameAndValue.Add(new KeyValuePair<string, string>("TableGroupKey", ""));
            _ParameterNameAndValue.Add(new KeyValuePair<string, string>("ColumnToSort", ""));
        }

        #region Module Codes (eg. MFood.cs module extra codes for SortAble)
        public override string GetModuleExtension(string _tableName)
        {
            string _result = "";

            string _role = GetTableRole(_tableName);
            switch (_role)
            {
                case "TableToSort":
                    _result = LoadTextFromFile("SortAbleModuleExtend1.txt");
                    _result = _result.Replace("{Table}", _RolenameAndTable["TableToSort"]);
                    _result = _result.Replace("{TablePrimaryKey}", GetParamStringListCode("TablePrimaryKey"));
                    _result = _result.Replace("{TableGroupKey}", GetParamStringListCode("TableGroupKey"));
                    _result = _result.Replace("{ColumnToSort}", GetParamStringCode("ColumnToSort"));
                    break;
            }
            return _result;
        }
        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior)
Singapore Singapore
I write code mostly in C#, VB.NET, PHP and Assembly.

Comments and Discussions