Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

1.can we add connection string in global.asax??????????
2.what are the default files included when we create new
web application????

Answer Posted / deepak

<%@ 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>

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are sessions used for?

1049


Explain about Multi-Language integration?

1067


What are early binding and late binding.

1131


What are the Types of chaching. How to implement caching

1071


Can master pages be nested?

978


Can we use html in asp.net?

983


What are resource file and how do we generate resource file?

1023


What are session state modes in asp.net?

1088


Explain the function of new view engine in asp.net? : asp.net mvc

1073


A Web Service Can Only Be Written In .net. Is it True??

1113


Can you explain one critical mapping? Performance issue which one is better? Whether connected lookup tranformation or unconnected one?

1311


Explain the difference between overriding and overloading?

1052


How do you secure your connection string information?

1038


Define msil.

1015


What are the various types of cookies in asp.net?

1075