hamed.alinejad
جمعه 06 مرداد 1391, 01:16 صبح
سلام دوستان مشکلی که دارم :
من یه برنامه توی ویژوال 2010 نوشتم و الان نیاز دارم به یه پایگاه داده تو اینترنت وصل بشه من یه بانک اس کیو ال تو سرور هاستینگ لینوکسم درست کردم و دسترسی هاشو دادم و از طریق این کانکشن تو برنامه خواستم بهش وصل بشم
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cn As New SqlConnection("Data Source=46.4.12.125:3306;Initial Catalog=fapardis_amlak;User ID=fapardis_amlak;Password=*****1")
Dim cmd As New SqlCommand
cmd.Connection = cn
cmd.CommandText = "insert into test1 values(@nam,@namkh)"
cmd.Parameters.AddWithValue("@nam", TextBox1.Text)
cmd.Parameters.AddWithValue("@namkh", Me.TextBox2.Text)
cn.Open()
cmd.ExecuteNonQuery()
cn.Close()
End Sub
که این خطا رو برای من میداد
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid)
ممنون میشم یکی کمک کنه
نکته جالب اینه که من دقیقا این کد رو یه سال پیش رو همین هاست تست کرده بودم و جواب داده بود
خیلی فوری هست
من یه برنامه توی ویژوال 2010 نوشتم و الان نیاز دارم به یه پایگاه داده تو اینترنت وصل بشه من یه بانک اس کیو ال تو سرور هاستینگ لینوکسم درست کردم و دسترسی هاشو دادم و از طریق این کانکشن تو برنامه خواستم بهش وصل بشم
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cn As New SqlConnection("Data Source=46.4.12.125:3306;Initial Catalog=fapardis_amlak;User ID=fapardis_amlak;Password=*****1")
Dim cmd As New SqlCommand
cmd.Connection = cn
cmd.CommandText = "insert into test1 values(@nam,@namkh)"
cmd.Parameters.AddWithValue("@nam", TextBox1.Text)
cmd.Parameters.AddWithValue("@namkh", Me.TextBox2.Text)
cn.Open()
cmd.ExecuteNonQuery()
cn.Close()
End Sub
که این خطا رو برای من میداد
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid)
ممنون میشم یکی کمک کنه
نکته جالب اینه که من دقیقا این کد رو یه سال پیش رو همین هاست تست کرده بودم و جواب داده بود
خیلی فوری هست