473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Problem with .NET remote

Hey guys I saw you have a lot of experiance in .net remoting so I am having a problem. I am getting a Requested Service Not Found error when I try to run a remote function. For this I use the following code for my Remote Class
Expand|Select|Wrap|Line Numbers
  1. Partial Public Class clsSQL
  2.     Inherits MarshalByRefObject
  3.     Dim DisSqlConn As SqlConnection
  4.  
  5.     Sub main()
  6.         Dim channel As TcpServerChannel = New TcpServerChannel(1234)
  7.         ChannelServices.RegisterChannel(channel, False)
  8.     End Sub
  9.     Public Function connectToDB()
  10.         Dim sysInfo As New clsConnection
  11.         Dim sqlUserName As String
  12.         Dim sqlPassWord As String
  13.         Dim SqlConnString As String
  14.         'set Username and Password for SQL Connection
  15.         sqlUserName = sysInfo.SQLUserName
  16.         sqlPassWord = sysInfo.SQLPassWord
  17.  
  18.         'initialize connection string
  19.         SqlConnString = "server=dissql;uid=" + sqlUserName + ";pwd=" + sqlPassWord + ";database=dis"
  20.         DisSqlConn = New SqlConnection(SqlConnString)
  21.  
  22.         'open the connection string
  23.         Try
  24.             DisSqlConn.Open()
  25.         Catch ex As Exception
  26.             Dim errorString As String = "error: "
  27.             errorString = errorString + ex.Message
  28.             MsgBox(errorString, MsgBoxStyle.Critical, )
  29.         End Try
  30.  
  31.     End Function
  32.     Public Function getCaseScreenInfo(ByVal caseNumber As String) As String()
  33.         Dim caseCommand As SqlCommand
  34.         Dim caseString As String
  35.         Dim drCase As SqlDataReader = Nothing
  36.  
  37.  
  38.         Me.connectToDB()
  39.         caseString = "select CASE_RECORD.CASE_NUMBER,CASE_RECORD.CASE_DESCRIPTION," _
  40.         & "CASE_RECORD.CASE_STATUS_CODE,CASE_RECORD.CASE_INDUSTRY_CODE," _
  41.         & "CASE_RECORD.CASE_PURPOSE_CODE,CASE_RECORD.CASE_OPENED_DATE," _
  42.         & "CASE_RECORD.CASE_DATE_CLOSED from dbo.CASE_RECORD" _
  43.         & " where CASE_RECORD.CASE_NUMBER='" & caseNumber & "'"
  44.         caseCommand = New SqlCommand(caseString, DisSqlConn)
  45.         Try
  46.             drCase = caseCommand.ExecuteReader()
  47.         Catch ex As Exception
  48.             MsgBox(ex.Message)
  49.         End Try
  50.         Dim caseValues(drCase.FieldCount) As String
  51.         If drCase.HasRows Then
  52.             While drCase.Read
  53.                 Dim i As Integer = drCase.FieldCount
  54.                 Dim i2 As Integer = 0
  55.                 While i >= 1
  56.                     caseValues(i2) = drCase(i2)
  57.                     i = i - 1
  58.                     i2 = i2 + 1
  59.                 End While
  60.  
  61.             End While
  62.             Return caseValues
  63.         End If
  64.     End Function
  65.  
  66.     Public Function closeDB()
  67.         Try
  68.             DisSqlConn.Close()
  69.             DisSqlConn = Nothing
  70.         Catch ex As Exception
  71.             MsgBox("error: " + ex.Message, MsgBoxStyle.OkOnly, )
  72.         End Try
  73.     End Function
  74. End Class
  75.  
and this for my listener
Expand|Select|Wrap|Line Numbers
  1. Imports System.Runtime.Remoting
  2. Imports System.Runtime.Remoting.Channels
  3. Imports System.Runtime.Remoting.Channels.Tcp
  4. Imports DISCLSV100
  5. Module modRemoteConn
  6.  
  7.     Sub Main()
  8.  
  9.         Dim channel As TcpServerChannel = New TcpServerChannel(49152)
  10.         ChannelServices.RegisterChannel(channel, False)
  11.         RemotingConfiguration.RegisterWellKnownServiceType(GetType(DISCLSV100.clsSQL), "clsSQL", WellKnownObjectMode.SingleCall)
  12.  
  13.  
  14.         Console.WriteLine("Server Started")
  15.         Console.WriteLine("Hit <enter> to quit")
  16.         Console.ReadLine()
  17.  
  18.     End Sub
  19.  
  20. End Module
and my call looks like this
Expand|Select|Wrap|Line Numbers
  1. Dim childCases As New frmCases
  2.             Dim caseChannel As TcpClientChannel = New TcpClientChannel()
  3.             ChannelServices.RegisterChannel(caseChannel, False)
  4.             RemotingConfiguration.RegisterWellKnownClientType(GetType(clsSQL), "tcp://jackie:49152/dbconnect")
  5.  
  6.             dbc = New clsSQL
  7.             Dim information() As String
  8.             information = dbc.getCaseScreenInfo(Me.mtxtCaseNum.Text)
  9.  
any ideas?

thanks Jackie
Apr 26 '06 #1
1 1607
Please Ignore I am a Moron and had the wrong TCP address
Apr 26 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: BadOmen | last post by:
I am using winLirc to receive date from my Packard Bell Fast media IR remote. The problem I have is that Winsock1_DataArrival(ByVal bytesTotal As Long) Is called two times almost every time I press...
4
by: Jaydeep | last post by:
Hello, I am facing a strange problem. Problem accessing remote database from ASP using COM+ server application having VB components (ActiveX DLL) installed. Tier 1 : ASP front End (IIS 5.0) Tire...
5
by: Data | last post by:
In my project I want to execute some commands on the remote machine. I am using .Net Remoting to achieve this. My server which is an exe is copied on the remote machine and it receives command from...
8
by: Don Riesbeck Jr. | last post by:
I have an C# EnterpriseService component that is part of an application I am developing that is responsible for writing data to an SQL Server. (it reads from a local DB (MSDE), then writes to a...
5
by: John | last post by:
Hi I am trying to get web reference to my first (!) web service which is on a remote host. I am getting the following error; Server Error in '/' Application. Runtime Error Description: An...
0
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
5
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
1
by: Mr. Beck | last post by:
Hello, Please Help..... I have been working with some tcp/ip socket communication within a C# program recently. Basicly, I have a program (myProblemProgram) that has a socket connected to...
1
by: Steve K. | last post by:
I'm working on my first remoting project. It's going well and I have one (that I know of!) bug left to work out. I understand how remote objects have leases and those leases expire. I fixed a...
0
by: okonita | last post by:
Hi all, I am having a DB2 connectivity problem that I hope someone can help me resolve. I need this to test Replication and such other things. What am I doing wrong here? Any help that I can get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.