public List <string> GetGetAllDb(dbserverdetails serverdetails)
        {
            string tmpConnectionString = $"server={serverdetails.dbserver};uid={serverdetails.userid};pwd={serverdetails.password}";

            var dynParams = new DynamicParameters();

            return(Db.FetchByConnection <string>(tmpConnectionString, "SELECT * from sys.databases order by name", dynParams));
        }
Beispiel #2
0
        public HttpResponseMessage GetAllDb(dbserverdetails serverdetails)
        {
            HttpResponseMessage response = null;

            try
            {
                var resultData = new DatamanagerBpl().GetAllDb(serverdetails);
                response = Request.CreateResponse(HttpStatusCode.OK, resultData);
            }
            catch (Exception ex)
            {
                response = Request.CreateErrorResponse(HttpStatusCode.Forbidden, ex);
            }
            return(response);
        }
Beispiel #3
0
        public HttpResponseMessage GetSchemaDetails(dbschemarequestdetails dbinforequest)
        {
            dbserverdetails     serverdetails = dbinforequest.serverdetailsReq;
            dbdetailsrequest    dbdetails     = dbinforequest.schemadetailsReq;
            HttpResponseMessage response      = null;

            try
            {
                var resultData = new DatamanagerBpl().GetSchemadetails(serverdetails, dbdetails);
                response = Request.CreateResponse(HttpStatusCode.OK, resultData);
            }
            catch (Exception ex)
            {
                response = Request.CreateErrorResponse(HttpStatusCode.Forbidden, ex);
            }
            return(response);
        }
        public List <DbSchemaDetails> GetSchemadetails(dbserverdetails serverdetails, dbdetailsrequest dbdetails)
        {
            strTableName  = dbdetails.TableName;
            strColumnName = dbdetails.ColumnName;
            strObjectType = "U";
            string strQueryExtension = $" and so.name like '%{strTableName}%' and sc.name like '%{strColumnName}%' AND  so.type in('{strObjectType}')";

            string tmpConnectionString = $"server={serverdetails.dbserver};Initial Catalog={serverdetails.database};uid={serverdetails.userid};pwd={serverdetails.password}";

            var dynParams = new DynamicParameters();

            dynParams.Add("@ColumnName", dbdetails.ColumnName);
            dynParams.Add("@TableName", dbdetails.TableName);
            dynParams.Add("@ViewName", dbdetails.ViewName);
            dynParams.Add("@SPName", dbdetails.StoredProcedure);

            return(Db.FetchByConnection <DbSchemaDetails>(tmpConnectionString, strdbschemaquery + strQueryExtension, dynParams));
        }
 public List <string> GetAllDb(dbserverdetails serverdetails)
 {
     return(new DataManagerRal().GetGetAllDb(serverdetails));
 }
 public List <DbSchemaDetails> GetSchemadetails(dbserverdetails serverdetails, dbdetailsrequest dbdetails)
 {
     return(new DataManagerRal().GetSchemadetails(serverdetails, dbdetails));
 }