.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> ASP.Net >> Post New Question Subscribe to Interview Questions

where to store Connection string in ASP.Net?

Posted By :Narayanan     Posted Date :October 24, 2011    Points :40   Category :ASP.Net 
in Web.config File
Syntax:
<connectionStrings>
<add name="dbconnection" connectionString="Data Source=Naraayanan;Integrated Security=true;Initial Catalog=MySampleDB"/>
</connectionStrings>

You can also find related Interview Question to where to store Connection string in ASP.Net?  below: 

Where do you store connection string?

  
Database connection string can be stored in the web config file.
The connection string can be stored in the WEB.Config file under
element. (More...)

What does connection string consist of?

  
The connection string consists of the following parts:
In general:

Server: Whether local or remote.

Uid: User Id (sa-in sql server)

Password: The required password to be filled-in here

Database: The database name. (More...)

How you will write a Connection String in web.Config fiel?

  
Ans) Then write below lines of code:

configuration>
connectionStrings>
add name="sqlconnectionstring" connectionString="Data Source=INTHIYAAZ;Initial Catalog=DB;User ID=sa;Password=sa" />
/connectionStrings>
/configuration>
(More...)

To perform asynchronous data access, what must be added to the connection string?

  
Select Correct Answer.

1. BeginExecute=true
2. MultiThreaded=true
3. MultipleActiveResultSets=true
4. Asynchronous=true

Correct Answer:
4. Asynchronous=true (More...)

Is it possible to update a connection string stored in the Web.config file programatically? If Yes, then how?

  
Yes.

Create a Configuration object. Then, update the connection string using the ConnectionStrings collection. Finally, call Configuration.Save. (More...)

What is connection pooling and what is the maximum Pool Size in ADO.NET Connection String?

  
A connection pool is created when a connection is opened the first time. The next time a connection is opened, the connection string is matched and if found exactly equal, the connection pooling would work.
Otherwise, a new connection is opened, and connection pooling won't be used.
Maximum pool size is the maximum number of connection objects to be pooled.
If the maximum pool size is reached, then the requests are queued until some connections are released back to the pool. It is therefore advisable to close the connection once done with it. (More...)

To create a string literal exclude escape sequence

  
@string. With adding @ at the beginning you can escape literal (More...)

String is an...........

  
String is an Object Type. where other data types are reference type in .NET (More...)

Difference between String.Empty and ""

  
The main difference is lies on memory management.

String.Empty will not create any object of string where as "" (Double Quote or Empty Quote) will create a new object in the memory for the checking the objects. (More...)

How do I convert a numeric type to a string?

  
Call Sytem.Object.ToString(). For example, if the variable count is an integer, write the following:
string text = count.ToString(); (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend