Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 February 16th, 2006, 01:20 AM
Registered User
Join Date: Feb 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting to Sql server database with ASP.NET

  Dear friends,

  I want to connect to sql server database. I am using ASP.NET 1.1 with C#2003. Could you tell me in step by step with codings.

Old February 16th, 2006, 04:54 AM
Friend of Wrox
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla

Hi saas,

(1)Define the connection string in web.config file.
(2)Refer System.Data.SqlClient in your web form which you are going to create the connection
(3)Open the connection as,

SqlConnection connection = new SqlConnection(System.Configuration.ConfigurationSe ttings.AppSettings["Connectionstring"]);

nalaka hewage
Old February 16th, 2006, 02:04 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts


You should check this out:

Old February 17th, 2006, 06:56 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts

And here a wonderful site if in doubt about the connection string...



Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net & sql server database naeem.net ASP.NET 2.0 Professional 13 July 18th, 2007 02:10 PM
ASP error when connecting to a new SQL server Cinderella Classic ASP Basics 2 June 21st, 2005 10:00 AM
Error in connecting to sql server 2000 using asp method SQL Server 2000 1 March 7th, 2005 11:05 PM
problem 2 connecting SQL Server 200 using ASP.NET nagen111 ADO.NET 5 February 16th, 2005 01:26 AM
Connecting to sql database w/ asp Calibus SQL Server ASP 7 July 8th, 2004 08:37 AM

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