SQL DATABASE

Connection to SQL Database Template

using (IDbConnection connection = new System.Data.SqlClient.SqlConnection (Helper.CnnVal("SampleDB")) )

 {

 }


PS:

public static class Helper

    {

        public static string CnnVal(string name)

        {

            return ConfigurationManager.ConnectionStrings[name].ConnectionString;

        }

    }

你可能感兴趣的:(SQL DATABASE)