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????

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / ahmad dawood

Yes you Can add Connection string in Global.aspx in the
[Sub Application_Start] or in the [Sub Session_Start]

Is This Answer Correct ?    7 Yes 0 No

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

Answer / jerry joseph

Connection String can be stored as an Application Variable.

Is This Answer Correct ?    6 Yes 0 No

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

Answer / sandeep

it is possible only by using session but it is not
good practics

Is This Answer Correct ?    4 Yes 1 No

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

Answer / jom george

we can add connection string in global.asax
2. App_Data,Default.aspx,Webconfif are the default files when we create a new web applications.

Is This Answer Correct ?    1 Yes 0 No

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

Answer / chaitali

no,we can't add the connection string in global.asax..
global.asax is a text file,It is use to define the global
variable.

Is This Answer Correct ?    1 Yes 7 No

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

Answer / himasankar

1)We can't add connection string in global.asax file. we can
create connection string in web.config file only.
2)global.asax,web.config,Default.aspx files and
app_code,app_data,app_themes folders.

Is This Answer Correct ?    4 Yes 12 No

Post New Answer

More ASP.NET Interview Questions

Why do we need Web Services?

1 Answers   Mind Tree,


What is the default timeout for a cookie?

0 Answers  


What are the two properties that are common in every validation control?

4 Answers   Siebel,


What is loop in asp.net?

0 Answers  


Can you explain autopostback?

0 Answers  


Explain the difference between panel and groupbox classes using .net?

0 Answers  


I create small website, i want accept all the browser this website? what will do?

1 Answers  


What is application variable and when it is initialized ?

4 Answers   Keane India Ltd,


What are the various authentication mechanisms in ASP.NET ?

1 Answers   Digital GlobalSoft, Satyam,


How do I force the dispose method to be called automatically, as clients can forget to call dispose method?

0 Answers  


What is the web.config file in asp?

0 Answers  


How to do state management in ASP.NET?

0 Answers   BirlaSoft,


Categories