SqlClient remote connection problems

Discussion in 'ASP .Net' started by Tony Zoccolillo, May 7, 2004.

  1. I have a SQL Server database on a Windows 2000 Server. I have IIS running
    on a 2nd 2000 Server with no SQL Server on it.. Neither are the PDC. Both
    servers have the most recent .NET framework installed.

    When I try to connect from my aspx page using SqlClient I get an error right
    away. My code looks something like...

    Imports System.Data.SqlClient

    Dim Conn2 As New SqlClient.SqlConnection("Data
    Source=10.10.10.101,1433;Initial Catalog=MapLayers; UID=coresqluser;
    PWD=OeQu_!102")
    Dim cmd As SqlClient.SqlCommand
    Dim objDataReader As SqlClient.SqlDataReader
    Dim strSQL As String
    Dim basename As String
    Dim appt As String
    Dim last_upd As String
    Dim n As Integer

    appt = Request.QueryString("atype")
    basename = Request.QueryString("thebase")

    Conn2.Open()

    strSQL = "SELECT * from site_name WHERE site_name.site_id = '" & basename &
    "';"
    cmd = New SqlClient.SqlCommand(strSQL, Conn2)
    objDataReader = cmd.ExecuteReader


    It errors on the "Imports" line....If I remove it, I get am error on the
    first DIM. It seems the problem is with the SqlClient class. If I put .NET
    framework on a machine without SQL Server, are these connectors installed?

    Any ideas or suggestions would be appreciated,

    Tony Zoccolillo
    Tony Zoccolillo, May 7, 2004
    #1
    1. Advertising

  2. This line should read...

    Source=10.10.10.101,1433;Initial Catalog=MapLayers; User ID=coresqluser;
    Password=OeQu_!102")




    "Tony Zoccolillo" <> wrote in message
    news:uN%2364f%...
    > I have a SQL Server database on a Windows 2000 Server. I have IIS running
    > on a 2nd 2000 Server with no SQL Server on it.. Neither are the PDC.

    Both
    > servers have the most recent .NET framework installed.
    >
    > When I try to connect from my aspx page using SqlClient I get an error

    right
    > away. My code looks something like...
    >
    > Imports System.Data.SqlClient
    >
    > Dim Conn2 As New SqlClient.SqlConnection("Data
    > Source=10.10.10.101,1433;Initial Catalog=MapLayers; UID=coresqluser;
    > PWD=OeQu_!102")
    > Dim cmd As SqlClient.SqlCommand
    > Dim objDataReader As SqlClient.SqlDataReader
    > Dim strSQL As String
    > Dim basename As String
    > Dim appt As String
    > Dim last_upd As String
    > Dim n As Integer
    >
    > appt = Request.QueryString("atype")
    > basename = Request.QueryString("thebase")
    >
    > Conn2.Open()
    >
    > strSQL = "SELECT * from site_name WHERE site_name.site_id = '" & basename

    &
    > "';"
    > cmd = New SqlClient.SqlCommand(strSQL, Conn2)
    > objDataReader = cmd.ExecuteReader
    >
    >
    > It errors on the "Imports" line....If I remove it, I get am error on the
    > first DIM. It seems the problem is with the SqlClient class. If I put

    ..NET
    > framework on a machine without SQL Server, are these connectors installed?
    >
    > Any ideas or suggestions would be appreciated,
    >
    > Tony Zoccolillo
    >
    >
    Tony Zoccolillo, May 7, 2004
    #2
    1. Advertising

  3. Tony Zoccolillo

    Rick Spiewak Guest

    Have you set a reference to the .dll? If so, perhaps you should set it to
    make a local copy, as a workaround.

    "Tony Zoccolillo" <> wrote in message
    news:ObA2ri%...
    > This line should read...
    >
    > Source=10.10.10.101,1433;Initial Catalog=MapLayers; User ID=coresqluser;
    > Password=OeQu_!102")
    >
    >
    >
    >
    > "Tony Zoccolillo" <> wrote in message
    > news:uN%2364f%...
    > > I have a SQL Server database on a Windows 2000 Server. I have IIS

    running
    > > on a 2nd 2000 Server with no SQL Server on it.. Neither are the PDC.

    > Both
    > > servers have the most recent .NET framework installed.
    > >
    > > When I try to connect from my aspx page using SqlClient I get an error

    > right
    > > away. My code looks something like...
    > >
    > > Imports System.Data.SqlClient
    > >
    > > Dim Conn2 As New SqlClient.SqlConnection("Data
    > > Source=10.10.10.101,1433;Initial Catalog=MapLayers; UID=coresqluser;
    > > PWD=OeQu_!102")
    > > Dim cmd As SqlClient.SqlCommand
    > > Dim objDataReader As SqlClient.SqlDataReader
    > > Dim strSQL As String
    > > Dim basename As String
    > > Dim appt As String
    > > Dim last_upd As String
    > > Dim n As Integer
    > >
    > > appt = Request.QueryString("atype")
    > > basename = Request.QueryString("thebase")
    > >
    > > Conn2.Open()
    > >
    > > strSQL = "SELECT * from site_name WHERE site_name.site_id = '" &

    basename
    > &
    > > "';"
    > > cmd = New SqlClient.SqlCommand(strSQL, Conn2)
    > > objDataReader = cmd.ExecuteReader
    > >
    > >
    > > It errors on the "Imports" line....If I remove it, I get am error on the
    > > first DIM. It seems the problem is with the SqlClient class. If I put

    > .NET
    > > framework on a machine without SQL Server, are these connectors

    installed?
    > >
    > > Any ideas or suggestions would be appreciated,
    > >
    > > Tony Zoccolillo
    > >
    > >

    >
    >
    Rick Spiewak, May 7, 2004
    #3
  4. I'm fairly new to .NET and I 'm not 100% sure what you mean. I have a
    reference to System, System.Data, System.Design, System.Drawing, System.Web,
    System.Windows.Forms and System.XML. Copy Local is False on all. If I set
    Copy Local to true, will it put the dlls in my bin and distributed when I
    copy remote? Shouldn't these refs already be on a system with .NET
    Framework installed?

    thanks,
    TZ


    "Rick Spiewak" <> wrote in message
    news:eAvr9$%...
    > Have you set a reference to the .dll? If so, perhaps you should set it to
    > make a local copy, as a workaround.
    >
    > "Tony Zoccolillo" <> wrote in message
    > news:ObA2ri%...
    > > This line should read...
    > >
    > > Source=10.10.10.101,1433;Initial Catalog=MapLayers; User ID=coresqluser;
    > > Password=OeQu_!102")
    > >
    > >
    > >
    > >
    > > "Tony Zoccolillo" <> wrote in message
    > > news:uN%2364f%...
    > > > I have a SQL Server database on a Windows 2000 Server. I have IIS

    > running
    > > > on a 2nd 2000 Server with no SQL Server on it.. Neither are the PDC.

    > > Both
    > > > servers have the most recent .NET framework installed.
    > > >
    > > > When I try to connect from my aspx page using SqlClient I get an error

    > > right
    > > > away. My code looks something like...
    > > >
    > > > Imports System.Data.SqlClient
    > > >
    > > > Dim Conn2 As New SqlClient.SqlConnection("Data
    > > > Source=10.10.10.101,1433;Initial Catalog=MapLayers; UID=coresqluser;
    > > > PWD=OeQu_!102")
    > > > Dim cmd As SqlClient.SqlCommand
    > > > Dim objDataReader As SqlClient.SqlDataReader
    > > > Dim strSQL As String
    > > > Dim basename As String
    > > > Dim appt As String
    > > > Dim last_upd As String
    > > > Dim n As Integer
    > > >
    > > > appt = Request.QueryString("atype")
    > > > basename = Request.QueryString("thebase")
    > > >
    > > > Conn2.Open()
    > > >
    > > > strSQL = "SELECT * from site_name WHERE site_name.site_id = '" &

    > basename
    > > &
    > > > "';"
    > > > cmd = New SqlClient.SqlCommand(strSQL, Conn2)
    > > > objDataReader = cmd.ExecuteReader
    > > >
    > > >
    > > > It errors on the "Imports" line....If I remove it, I get am error on

    the
    > > > first DIM. It seems the problem is with the SqlClient class. If I

    put
    > > .NET
    > > > framework on a machine without SQL Server, are these connectors

    > installed?
    > > >
    > > > Any ideas or suggestions would be appreciated,
    > > >
    > > > Tony Zoccolillo
    > > >
    > > >

    > >
    > >

    >
    >
    Tony Zoccolillo, May 7, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yangtsi River
    Replies:
    0
    Views:
    397
    Yangtsi River
    Jul 2, 2003
  2. William F. Robertson, Jr.

    Re: vbc cant find system.data.sqlClient.sqlConnection

    William F. Robertson, Jr., Jul 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    642
    William F. Robertson, Jr.
    Jul 28, 2003
  3. Stan
    Replies:
    0
    Views:
    589
  4. Jeff
    Replies:
    1
    Views:
    494
  5. VR

    remote connection to SQL server problems

    VR, Sep 22, 2003, in forum: ASP .Net Security
    Replies:
    3
    Views:
    133
    Jacob Yang [MSFT]
    Sep 24, 2003
Loading...

Share This Page