예제 #1
0
        public virtual string GetTableScript(string tableName, string server, string username, string password, string database)
        {
            var sqlConnectionString = "Data Source=" + server + ";User Id=" + username + ";Password="******";Initial Catalog=" + database + ";";

            _sqlCon.ConnectionString = sqlConnectionString;

            var common   = new ClsCommon();
            var dst      = common.GetDatasetFromSqlQuery(ClsQueries.SqlGettablescript.Replace("{TABLENAME}", tableName), _sqlCon);
            var response = common.ConvertDatasettoString(dst);

            return(response);
        }
예제 #2
0
        public string GetPrimaryKey(string tableName, string server, string username, string password, string database)
        {
            var sqlConnectionString = "Data Source=" + server + ";User Id=" + username + ";Password="******";Initial Catalog=" + database + ";";

            _sqlCon.ConnectionString = sqlConnectionString;

            var common   = new ClsCommon();
            var dst      = common.GetDatasetFromSqlQuery(ClsQueries.SqlGetprimarykey.Replace("{TABLENAME}", tableName), _sqlCon);
            var response = dst.Tables[0].Rows[0][1].ToString();

            return(response);
        }