Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2005, 10:01 AM
Authorized User
 
Join Date: Mar 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data base connection string needed

Hello guys...
          I have a problem which deals with the connection string for database.
I am using SQLserver Desktop engine.It is installed in WindowsNT Authentication mode.
I used to give the connection string as

<appSettings>
 <add key="ConnectionString" value="server=ServerName;uid= ;pwd= ;database=DatabaseName"/>
    </appSettings>

inside the "web.config" file.Is this connection string is enough or i need to change this? Please Help me..

Regards.


 
Old March 2nd, 2005, 11:40 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Well, does the connection work?
 
Old March 4th, 2005, 07:10 AM
Authorized User
 
Join Date: Feb 2005
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ashokparchuri Send a message via Yahoo to ashokparchuri
Default

yes that is the string you need to connect to database and just keep the below string in the page you need to connect to the database.
cn = New SqlConnection(ConfigurationSettings.AppSettings("s trConn"))

cn is connection object,str connection is the key value you gave after add key.

when i folloe your appsettings i have to give connectionstring insted of strconn..but i thought it will be bit confusing...

hope this will be useful for you-Ashok
 
Old March 8th, 2005, 01:21 PM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No the connection string should be as follows

"Server=<server>;Database=<db name>;Trusted_Connection=True;Integrated Security=SSPI"

For connection strings you can try the following URL which has all connection string samples

http://www.connectionstrings.com



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa





Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Shaping Connection String mat41 Classic ASP Professional 4 August 6th, 2008 02:19 AM
Chapter3: Data Connection String pinponpan BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 0 June 21st, 2008 10:08 PM
Transfering data from csv file to data base g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 2 May 16th, 2006 11:58 PM
Data Base Connection ashraf Javascript 4 November 27th, 2004 06:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.