Connecting to MSSQL 2005 Server with

Connecting to MSSQL Server with is fairly easy. Just follow the steps below:

1. Create a database in MSSQL Server 2005 (I'm using MSSQL Server Express 2005).
I've created the following database structure:

Database Name: Pawnshop Table: Jewelry Fields: Id Name Type

I filled it up with the following values:

Id Name Type
Gold Necklace Necklace
Gold Watch Watch
Gold Earrings Earrings
4 Silver Bullet Bullet

5 Silver Dust Dust

Gold Coin Coin
7 Bronze Medal Medal

8 Bronze bracelet Bracelet

9 Aluminum Foil Foil

Gold Ring Ring

2. Create a new Project
3. Add a DataGridView to the form
4. Double Click on the Form and Replace all codes with the following (my server ip address is Replace with your own ip address. replace the user and password accordingly):

Imports System.Data.SqlClient

Public Class Form1
Dim cn As New SqlConnection("Data Source=\SQLEXPRESS;Initial Catalog=Pawnshop;User Id=sa;Password=password;")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cmd As New SqlCommand("select * from Jewelry", cn)
Dim adp As New SqlDataAdapter(cmd)
Dim dt As New DataTable()
DataGridView1.DataSource = dt
End Sub
End Class

5. Run the program

You can download the source code and database here.

Connect to the best online keno and blackjack games, and try out roulette online at!


2 Responses to "Connecting to MSSQL 2005 Server with"

Dmitry said... November 16, 2009 at 5:24 AM

Hi fiShBoN3, you may also try the foxpro dbf repair program, it automates the procedure of database recovery, if something goes wrong

Helga said... December 1, 2009 at 5:05 AM

Hi Dmitry, do you mean the recover corrupted sql system database in 2005 utility? I have tried several ways to restore affected databases and I have completely lost in these solutions