1stly here's the error I am getting
Now this isn't as straight off as it sounds.SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 8: Dim Adapter As New SqlDataAdapter(SQL, Conn)
Line 9: Dim DS As New DataSet
Line 10: Adapter.Fill(DS)
Line 11: Return DS
Line 12: End Function
My Function is:
Now I have 2 connection strings. 1 for my local SQL server, and one for the remote one. This look like:VB Code:
Public Function GetDataSet(ByVal SQL As String) As DataSet Dim Conn As New SqlConnection(CONN_STRING) Dim Adapter As New SqlDataAdapter(SQL, Conn) Dim DS As New DataSet Adapter.Fill(DS) Return DS End Function
Now if I add:VB Code:
Private Const CONN_STRING As String = "Password=woof;Persist Security Info=True;User ID=sa;Initial Catalog=BadgerWeb;Data Source=DBSERVER"
To the front of this conn string then it works for ado in VB6.Code:Provider=SQLOLEDB.1;
OK. Now the error I am getting is on the Fill method.
This ONLY occurs when I try to get data using .NET AND the SQL Server on another PC.
If I use VB6, and the same modified conn string, and access data on the SQL Server on another PC then it works.
It's ONLY a problem with .NET
Woof





Reply With Quote