منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
فورم التحقق من الاتصال بالسيرفر - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم قواعد البيانات (http://vb4arb.com/vb/forumdisplay.php?fid=40)
+--- قسم : قسم أسئلة قواعد البيانات تحت بيئة الـ.NET (http://vb4arb.com/vb/forumdisplay.php?fid=41)
+--- الموضوع : فورم التحقق من الاتصال بالسيرفر (/showthread.php?tid=2349)



فورم التحقق من الاتصال بالسيرفر - محاسب يوسف - 24-03-14

السلام عليكم لدي برنامج
يحتاج اكواد التحقق من الاتصال بسكول سواء كان يحتوي كلمة مرور او لا


RE: فورم التحقق من الاتصال بالسيرفر - info@cnr - 26-03-14

thanks........


RE: فورم التحقق من الاتصال بالسيرفر - محاسب يوسف - 26-03-14

محتاج مساعدة لو سمحتم


RE: فورم التحقق من الاتصال بالسيرفر - salfig - 26-03-14

تفضل اخي
وفي حال لم يفتح معك لاني استخدم فيجوال بيسك 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 ObjectAs EventArgsHandles 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.MessageMsgBoxStyle.Critical"Error")
            Return 
False
        End 
Try
    
End Function
End Class 



RE: فورم التحقق من الاتصال بالسيرفر - مالكـ - 27-03-14

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() 



RE: فورم التحقق من الاتصال بالسيرفر - محاسب يوسف - 27-03-14

بارك الله بكم وشكرا للرد