Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 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 28th, 2005, 04:23 AM
Registered User
 
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Database connection

Hi,


Can anybody tell me the step by step process how to connect to database (Access) and retrieve data ?


Thanks

Thanks

Regards
Sheetal Patil
 
Old January 6th, 2006, 11:49 PM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Every One i have sqlserver connections.
Drag and drop the sqlconnection from web forms.
and
include the name space called using system.data.sqlclient
then write code

string regstr="workstation id=HY;packet size=4096;user id=sa;pwd=sa;data source=DATASERVER;persist security info=False;initial catalog=Senthilkumar";
            SqlConnection regcon = new SqlConnection(regstr);
            regcon.Open();
            string regqry="insert into UserReg values('"+txtUserId.Text+"','"+txtPassword.Text+"' ,'"+txtReEnterPassword.Text+"','"+txtfirstname.Tex t+"','"+txtMiddlename.Text+"','"+txtLasrName.Text+ "','"+txtAddress.Text+"','"+txtPinCode.Text+"','"+ txtCountary.Text+"','"+txtState.Text+"','"+txtPhon eHome.Text+"','"+txtPhoneMobile.Text+"','"+txtMobi leOffice.Text+"')";
            SqlCommand regcmd = new SqlCommand(regqry,regcon);
            regcmd.ExecuteReader();
            regcon.Close();






Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Connection to Access Database reachsevar ASP.NET 2.0 Basics 1 November 28th, 2007 08:56 AM
Database Connection oneillg PHP Databases 1 October 17th, 2007 04:48 PM
Database Connection kapi.goel SQL Language 2 February 14th, 2006 07:01 PM
database connection Nitin_sharma Classic ASP Databases 1 February 8th, 2005 10:23 AM





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