Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim conn As New OleDb.OleDbConnection("Provider=SQLNCLI;Server=.\SQLEXPRESS;Database=TênData; Uid=sa; Pwd=MậtKhau;") conn.Open() Dim cmd As New OleDb.OleDbCommand("CREATE TABLE persons ( " & _ "AutoId int identity ," & | Kêt nôi dû lieu tù SQL 2005 sang Visual Basic 2005 Nguôn forum.t3h.vn Private Sub Button1_Click ByVal sender As System.Object ByVal e As System.EventArgs Handles Buttonl.Click Dim conn As New OleDb.OleDbConnection Provider SQLNCLI Server . SQLEXP RESS Database TênData Uid sa Pwd MâtKhau conn.Open Dim cmd As New OleDb.OleDbCommand CREATE TABLE persons _ Autold int identity _ Id int NOT NULL _ Name NVarchar 50 _ BirthDate datetime _ IdCountry int _ CONSTRAINT pk_AutoId PRIMARY KEY Autold conn Try cmd.ExecuteNonQuery Catch ex As OleDb.OleDbException MessageBox.Show ex.Message OleDbException Catch ex As Exception MessageBox.Show ex.Message GeneralException End Try conn.Close End .