Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Web;
- namespace MVC5App.Models
- {
- public class Helpers
- {
- public static string GetRDSConnectionString()
- {
- var appConfig = ConfigurationManager.AppSettings;
- string dbname = appConfig["RDS_DB_NAME"];
- if (string.IsNullOrEmpty(dbname)) return null;
- string username = appConfig["RDS_USERNAME"];
- string password = appConfig["RDS_PASSWORD"];
- string hostname = appConfig["RDS_HOSTNAME"];
- string port = appConfig["RDS_PORT"];
- return "Data Source=" + hostname + ";Initial Catalog=" + dbname + ";User ID=" + username + ";Password=" + password + ";";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement