Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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 November 6th, 2006, 01:16 AM
Authorized User
 
Join Date: Oct 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection

Hi Frnds,

          I am very new in ASP.NET application. Can you please tell how to make a connection between ASP.NET and MS SQL SERVER 2000? Also I want to display all the data in ASP.NET form. Please help me to learn ASP.NET.

Thanks in Advance

 
Old November 6th, 2006, 03:44 AM
Authorized User
 
Join Date: Aug 2006
Posts: 39
Thanks: 1
Thanked 0 Times in 0 Posts
Default

write,
using System.Data.SqlClient at top of the .cs page

on any event where you want to make connection write

string strConn="Data Source=<Server name>;Initial Catalog=<database name>;uid=<user id>;pwd=<password>";

SqlConnection con = new SqlConnection(strConn);

to open connection write
con.open();

do next what u like....

 
Old November 7th, 2006, 02:39 AM
Authorized User
 
Join Date: Oct 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi NITINP,

            Thanks for ur help and reply. Now I have another question. I want to show one data from database in a textbox. I think I need to databind. But how to do this??

Waiting for ur reply.


 
Old November 7th, 2006, 03:55 AM
Authorized User
 
Join Date: Aug 2006
Posts: 39
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Do you want to do a simple process of getting data into a text box or want to populate a text box in GridView or other at run time? Pls tell me specifically.

 
Old November 7th, 2006, 04:01 AM
Authorized User
 
Join Date: Aug 2006
Posts: 39
Thanks: 1
Thanked 0 Times in 0 Posts
Default

http://www.asp.net/getstarted/default.aspx?tabid=61 could be helpful.


 
Old November 7th, 2006, 06:21 AM
Authorized User
 
Join Date: Oct 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Nitin for ur help..






Similar Threads
Thread Thread Starter Forum Replies Last Post
connection ScottSheck BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 June 14th, 2006 05:54 PM
open connection in another connection adityamadisetty SQL Server 2000 1 May 4th, 2006 04:56 AM
Connection zaeem Dreamweaver (all versions) 1 May 1st, 2005 04:57 AM
Connection Help morpheus Classic ASP Basics 2 February 3rd, 2005 09:09 AM
connection through C kaushikroy C++ Programming 1 January 30th, 2004 07:30 AM





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