בעיה בהתקשרות ל-SQLSERVER2005
יש לי CLASS לקישור למסד נתונים של SQLSERVER 2005 הנה הוא לפניכם. Imports System.Data.OleDb Imports system.Data.Sqlclient Public Class ClsDBsql Public con As New SqlConnection 'OleDbConnection Private adp As New SqlDataAdapter Private com As New SqlCommand Public Sub doConnection(ByVal dbName As String) con.ConnectionString = "Server=SERVER;Database=koly;UID=1;PWD=147;" ' con.ConnectionString = "Data Source=SERVER;Initial Catalog=koly;Integrated Security=True" End Sub Public Function getData(ByVal sql As String) As Data.DataTable ' con.Open() Dim dt As New Data.DataTable adp = New SqlDataAdapter(sql, con) adp.Fill(dt) con.Close() Return dt End Function Public Sub upDate(ByVal sql As String) con.Open() com = New SqlCommand(sql, con) com.ExecuteNonQuery() con.Close() End Sub Public Sub closeConnection() con.Close() End Sub End Class אבל משום מה אני לא מצליחה לשלוף נתונים הוא כותב לי כל פעם את הודעת השגיאה הבאה: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) משהו יכול לעזור לי בבקשה!!!!!!!!!!!!!!11
יש לי CLASS לקישור למסד נתונים של SQLSERVER 2005 הנה הוא לפניכם. Imports System.Data.OleDb Imports system.Data.Sqlclient Public Class ClsDBsql Public con As New SqlConnection 'OleDbConnection Private adp As New SqlDataAdapter Private com As New SqlCommand Public Sub doConnection(ByVal dbName As String) con.ConnectionString = "Server=SERVER;Database=koly;UID=1;PWD=147;" ' con.ConnectionString = "Data Source=SERVER;Initial Catalog=koly;Integrated Security=True" End Sub Public Function getData(ByVal sql As String) As Data.DataTable ' con.Open() Dim dt As New Data.DataTable adp = New SqlDataAdapter(sql, con) adp.Fill(dt) con.Close() Return dt End Function Public Sub upDate(ByVal sql As String) con.Open() com = New SqlCommand(sql, con) com.ExecuteNonQuery() con.Close() End Sub Public Sub closeConnection() con.Close() End Sub End Class אבל משום מה אני לא מצליחה לשלוף נתונים הוא כותב לי כל פעם את הודעת השגיאה הבאה: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) משהו יכול לעזור לי בבקשה!!!!!!!!!!!!!!11