Saturday, September 8, 2018

Server Side Configuration String and access

Web.config  File 

<?xml version="1.0"?>
<configuration>



  <appSettings>


    <add key="keyname" value="Data Source=ipaddress;

                              Network Library=DBMSSOCN;

                              Connection Timeout=15;

                              Packet Size=4096;

                              Integrated Security=no;

                               Initial Catalog=databasename;

                               User ID=username;

                               password=password;

                               Encrypt=no;

                               Max Pool Size=50000;"/>

  </appSettings>

<system.web>

            <customErrors mode="Off"/>

<compilation debug="true" targetFramework="4.0"/>

</system.web>

</configuration>



======================================================================

How to access Config  File 

using System.Configuration;

 SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["keyname"]);

con.Open();






No comments:

Post a Comment

GRIDVIEW ON ROW DATA BOUND EVENT

 Database Create  Student : roll , name , city , cost  Fix 6 Value  in Database Record  ====================================================...