Option Explicit On
Option Strict On
Imports System.Data
Imports System.Data.SqlClient
Public Class frmMain
Dim objConn As SqlConnection
Dim objCmd As SqlCommand
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strConnString As String
strConnString = "Server=localhost;Uid=sa;PASSWORD=024274628;database=GAFBiz;Max Pool Size=400;Connect Timeout=600;"
objConn = New SqlConnection(strConnString)
objConn.Open()
If objConn.State = ConnectionState.Open Then
MessageBox.Show("SQL Server Connected")
Else
MessageBox.Show("SQL Server Connect Failed")
End If
Me.WindowState = FormWindowState.Maximized
End Sub
database=GAFBiz << ชื่อ ของ sql ที่เราสร้างไว้ใน sql server 2008 ใช่มะครับ
Error 1 Unable to copy file "obj\Debug\Hong New.exe" to "bin\Debug\Hong New.exe". The process cannot access the file 'bin\Debug\Hong New.exe' because it is being used by another process. Hong New