What is the Difference between Web.config and global.asax?
Can we write connection String code in global.asax?

Answer Posted / dasharatham

sorry to the above answer which is applicable to ASP.NET
application folders..


web.config is which is used for settings to an application
in future requirement.

Global.asax which is handling application level events and
session level events..

I expected we can place the connection string like this
void Session_Start(object sender, EventArgs e)
{
Application["sqldb"] = ConfigurationManager.AppSettings
["constr"].ToString();
}

Is This Answer Correct ?    7 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are ASP.NET Web Forms? How is this technology different than what is available though ASP?

945


Is it possible to change the index of primary key on table?

412


What's the use of response.output.write()?

768


Explain model, view and controller represent in an mvc application? : asp.net mvc

519


What are the contents of cookie?

578






What is ipostback?

603


Explain difference betn dataset and recordset?

534


What is session and cookies in asp.net?

557


Tell me the code snippet to show how we can return 404 errors from HttpError?

792


What is the concept of view state in asp.net?

565


Do you know about caching with the datasource controls?

486


What is the difference between a page theme and a global theme?

546


In a page I have gridview with options of select and delete using hyperlink when I am selecting any one of then it has to open another page how can it?

510


What is autopost?

531


Difference between DataGid and Girdview? Difference b/w .Net 2.0, 3.0 and 3.5 ? Diff b/w dispose & Finialize Methods?

2033