Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 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 February 3rd, 2010, 02:29 PM
Authorized User
 
Join Date: Mar 2009
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Thumbs down how to make connection with sql 2005 database

hi Friends,
I am working with the small project of Invice Package.
i have using the Visual Studio 2005
the project is in VB.Net
so how to make the connection of this variables with the SQL server 2005
& where can i get the code samples?
 
Old February 4th, 2010, 01:00 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

To get connection strings, please check the following site:
http://www.connectionstrings.com/
For examples, please check the following links:
http://www.developerfusion.com/artic...th-sql-server/

Example:
Code:
 Dim thisConnection As New SqlConnection("server=(local)\SQLEXPRESS;integrated security=sspi;database=MyDatabase")
 Dim thisCommand As New SqlCommand ("SELECT FirstName FROM Employee", thisConnection)
 ' Open Connection
 thisConnection.Open()
 ' Execute Query
 Dim thisReader As SqlDataReader = thisCommand.ExecuteReader()
 While (thisReader.Read())
    Console.WriteLine("Name: {0}", thisReader(0))
 End While
 'Close DataReader
 thisReader.Close()
 thisConnection.Close()
Please check following URL (Database ADO.net Section) for more examples:
http://www.java2s.com/Code/VB/CatalogVB.htm
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.
The Following User Says Thank You to om_prakash For This Useful Post:
UmeshA (February 5th, 2010)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sql server 2005 connection problem Mahenj C# 2005 17 April 20th, 2015 12:12 AM
VB 2005 SqlServer database connection chandra7 ADO.NET 0 December 1st, 2008 10:20 AM
Bugbase SQL 2005 remote connection error dtcalif BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 January 12th, 2007 06:46 PM
Database connection in VB 2005 atoyot VB Databases Basics 0 September 30th, 2006 10:52 PM
How to make a connection with access database arshad mahmood Classic ASP Professional 1 April 18th, 2006 03:53 AM





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