zoukankan      html  css  js  c++  java
  • Get ConnectString Form Web.config

    Listing 11-14: Building connection strings using ConnectionStringBuilder
    VB
    ‘ Retrieve an existing connection string into a Connection String Builder
    Dim builder As New System.Data.SqlClient.SqlConnectionStringBuilder()
    ‘ Change the connection string properties
    builder.DataSource = “localhost”
    builder.InitialCatalog = “Northwind1”
    builder.UserID = “sa”
    builder.Password = “password”
    builder.PersistSecurityInfo = true
    ‘ Save the connection string back to the web.config
    ConfigurationManager.ConnectionStrings(“AppConnectionString1”).ConnectionString = _
    builder.ConnectionString
    C#
    System.Data.SqlClient.SqlConnectionStringBuilder builder = new
    System.Data.SqlClient.SqlConnectionStringBuilder();
    // Change the connection string properties
    builder.DataSource = “localhost”;
    builder.InitialCatalog = “Northwind1”;
    builder.UserID = “sa”;
    builder.Password = “password”;
    builder.PersistSecurityInfo = true;
    // Save the connection string back to the web.config
    ConfigurationManager.ConnectionStrings[“AppConnectionString1”].ConnectionString =
    builder.ConnectionString;
  • 相关阅读:
    Django REST framework的解析器与渲染器
    python基础之 数据格式化
    REST framework 之 分页
    Django REST framework 之 认证 权限 限制
    DjangoRestFrameWork 版本控制
    DjangoRESTFrameWork中的视图
    浏览器跨域问题
    初识REST
    vue之生命周期
    vue组件
  • 原文地址:https://www.cnblogs.com/xucanzhao/p/355625.html
Copyright © 2011-2022 走看看