Connect to Datasource in VB.Net

Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click
Try
ConnectionString = “Data Source= ” + txtdatasource.Text + “;Initial Catalog=” + txtinitialcat.Text + “;Integrated Security=SSPI;User ID=sa;Password=test;Connection Timeout=60″
MessageBox.Show(ConnectionString)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 215 other followers

%d bloggers like this: