24-03-14, 10:51 AM
26-03-14, 11:23 AM
thanks........
26-03-14, 11:39 AM
محتاج مساعدة لو سمحتم
26-03-14, 07:56 PM
تفضل اخي
وفي حال لم يفتح معك لاني استخدم فيجوال بيسك 2012 هذا الكود
وفي حال لم يفتح معك لاني استخدم فيجوال بيسك 2012 هذا الكود
PHP كود :
Imports System.Data.SqlClient
Public Class Form1
Dim conn As New SqlConnection
Dim cmd As New SqlCommand
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If Connection() = True Then
MsgBox("Connection Successfully", MsgBoxStyle.Information, "Connection")
Else
MsgBox("Error")
End If
End Sub
Private Function Connection()
Try
conn.ConnectionString = "Data Source=" & txtServer.Text & ";Initial Catalog=" & txtDatabase.Text & ";User ID=" & txtUser.Text & ";Password=" & txtPass.Text & ";Integrated Security=True"
cmd.Connection = conn
conn.Open()
Return True
Catch ex As Exception
MsgBox("Error : " & ex.Message, MsgBoxStyle.Critical, "Error")
Return False
End Try
End Function
End Class
27-03-14, 07:53 AM
PHP كود :
Dim conn As New SqlClient.SqlConnection()
Try
conn.ConnectionString = "Data Source=" & txtServer.Text & ";" & "user id=" & txtUsername.Text & ";" & "pwd=" & txtPassword.Text & ";" & "Initial Catalog=" & txtDatabase.Text
conn.Open()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
If conn.State = ConnectionState.Open Then
MessageBox.Show("تم الاتصال بنجاح")
Else
MessageBox.Show("لم يتم الاتصال")
End If
conn.Close()
27-03-14, 10:25 AM
بارك الله بكم وشكرا للرد