ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories >> Software >> Microsoft-Related >> ASP.NET
 
 
 
Question
1.can we add connection string in global.asax??????????
2.what are the default files included when we create new 
web application????
 Question Submitted By :: Aseem
I also faced this Question!!     Rank Answer Posted By  
 
Answer
<%@ Import Namespace=”System.Data” %>
<%@ Import Namespace=”System.Data.Odbc” %> <script
language=”C#” runat=”server”>
    void Application_Start()
    {
        //Connection string for SQL Server with trusted
connection
        Application.Add (”DB_CONNECTION_STRING”,”DRIVER={SQL
Server};SERVER=ServerName;DATABASE=DataBaseName;Trusted_connection=yes;”);
    }
    void Session_Start()
    {
        //open connection to database
        OdbcConnection  cnConnection = new OdbcConnection
(Application.Get(”DB_CONNECTION_STRING”).ToString());
        cnConnection.Open();
        Session.Add (”DB_CONNECTION”, cnConnection );
    }
    void Session_End()
    {
        //a graceful disconnect
        OdbcConnection cnConnection = (OdbcConnection)
Session["DB_CONNECTION"];
        cnConnection.Close ();
    }
</script>
 
0
Deepak
 
View All Answers
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com