Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 2nd, 2005, 10:01 AM
Authorized User
 
Join Date: Mar 2005
Location: , , .
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.


Reply With Quote
  #2 (permalink)  
Old March 2nd, 2005, 11:40 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Well, does the connection work?
Reply With Quote
  #3 (permalink)  
Old March 4th, 2005, 07:10 AM
Authorized User
 
Join Date: Feb 2005
Location: hyderabad, Andhara Pradesh, India.
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
Reply With Quote
  #4 (permalink)  
Old March 8th, 2005, 01:21 PM
Friend of Wrox
 
Join Date: Feb 2004
Location: Bangalore, Karnataka, India.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:26 AM.


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