How we give connection strings in config files?

Showing Answers 1 - 3 of 3 Answers

sudheer_ramoju

  • Jan 23rd, 2007
 

This is the code to attach an Connection string to Config File Add key name = " " value =" user id=; password=< Your password>;server ;database = This should shoud be writen in web.config file of connection string tag.....eg: // In configuration section

  Was this answer useful?  Yes

prema

  • Jan 24th, 2007
 

hai, In web.config file write this try this.

  Was this answer useful?  Yes

Promothash Boruah

  • Feb 12th, 2007
 

In the web.config file under the App settings add these line.

< appSettings >
< add key="ConnectionString" value="Server='servername';initial catalog='databasename';User ID='youruserID';password='yourpassword'"/ >
< /appSettings >

To get the values in the code behind file.String con=ConfigurationManager.AppSettings["ConnectionString"] ;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions