473,770 Members | 5,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Network Application - basic question

How do I communicate between different user instances of my windows
forms project?

Im trying to write a program that will run on a network of 15 pcs.

5 of the pc's will run the admin part of the program. and the rest of
the pc's will run the salesman part of the program.

Both forms (the admin form, and the salesman form) at this stage are
VERY simple as i'm just trying to learn the mechanics between basic
form communication accross the network.

The admin form has a couple of labels, a text box and a drop down box.
The text box allows the admin person to enter a leads name, and the
dropdown box allows the admin person to select which salesman they want
to send the lead to. Then when they press OK here is what i need to
happen...

Lets say from the dropdown box they selected the salesman called JOHN.

On Johns PC the app will popup a box alerting him that he has an
incoming lead.

It then pops up the salesman form, with the previously entered customer
name already populated and the time and date info also populated from
the data the admin person entered before they sent him the lead.

Can someone please explain how I achieve the above. I can create the
forms with no problems of course, but my question is asking about the
network side of things and how i actually get the forms to communicate
with each other / and find the right users form to activate.

Many Thanks.

Nov 21 '06 #1
10 3327
Well I suppose there must be dozens of ways to do this; but I think the
most straight forward way to do it, just to get you started, would be
to put a database in the middle. User makes selections on the admin
form and writes info to the database. The salesman form polls the
database on regular basis, and when it finds new information it
displays it on the salesman form.

This should be enough to get you started.

--
Cheers,
Gary
http://www.garyshort.org/
CCLeasing wrote:
How do I communicate between different user instances of my windows
forms project?

Im trying to write a program that will run on a network of 15 pcs.

5 of the pc's will run the admin part of the program. and the rest of
the pc's will run the salesman part of the program.

Both forms (the admin form, and the salesman form) at this stage are
VERY simple as i'm just trying to learn the mechanics between basic
form communication accross the network.

The admin form has a couple of labels, a text box and a drop down box.
The text box allows the admin person to enter a leads name, and the
dropdown box allows the admin person to select which salesman they want
to send the lead to. Then when they press OK here is what i need to
happen...

Lets say from the dropdown box they selected the salesman called JOHN.

On Johns PC the app will popup a box alerting him that he has an
incoming lead.

It then pops up the salesman form, with the previously entered customer
name already populated and the time and date info also populated from
the data the admin person entered before they sent him the lead.

Can someone please explain how I achieve the above. I can create the
forms with no problems of course, but my question is asking about the
network side of things and how i actually get the forms to communicate
with each other / and find the right users form to activate.

Many Thanks.
Nov 21 '06 #2
Hi,

It sounds like you should be using a central server.

If you want to use remoting, each client that logs in can establish a
remoting session with a central server via a well known IP address. The
client can pass information about its own remoting service being hosted
locally so that the central server can establish a remoting connection back
to the client. The server will have to maintain a list of client remoting
objects as well as its own hosted object to which clients connect.

The remoting server can act to dispatch incoming messages to its clients.

You'll need to configure a class that derives from MarshalByRefObj ect to be
hosted as a server-activated SingleCall or Singleton (preferred).

".NET Remoting Overview"
http://msdn2.microsoft.com/en-us/library/kwdt6w2k.aspx

You could do this on a lower level using Sockets too:

"TcpListene r Class"
http://msdn.microsoft.com/library/de...asp?frame=true

--
Dave Sexton

"CCLeasing" <ga**@ccleasing .co.ukwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
How do I communicate between different user instances of my windows
forms project?

Im trying to write a program that will run on a network of 15 pcs.

5 of the pc's will run the admin part of the program. and the rest of
the pc's will run the salesman part of the program.

Both forms (the admin form, and the salesman form) at this stage are
VERY simple as i'm just trying to learn the mechanics between basic
form communication accross the network.

The admin form has a couple of labels, a text box and a drop down box.
The text box allows the admin person to enter a leads name, and the
dropdown box allows the admin person to select which salesman they want
to send the lead to. Then when they press OK here is what i need to
happen...

Lets say from the dropdown box they selected the salesman called JOHN.

On Johns PC the app will popup a box alerting him that he has an
incoming lead.

It then pops up the salesman form, with the previously entered customer
name already populated and the time and date info also populated from
the data the admin person entered before they sent him the lead.

Can someone please explain how I achieve the above. I can create the
forms with no problems of course, but my question is asking about the
network side of things and how i actually get the forms to communicate
with each other / and find the right users form to activate.

Many Thanks.

Nov 21 '06 #3
Thanks but i don't know how to interface with databases in c# express.

I tried sometime ago to interface with a mysql database but got stuck
somewhere along the way. I don't want to use ms sql server because of
the licencing requirements.

Thanks, any further advice would be appreciated.

Nov 21 '06 #4
Its fairly simply; you use SqlClient (For sql server) or OdbcClient or
OleDbClient (if mysql supports oledb) to talk to the database. Just
look at Ado.net topics.

Out of curiosity, what licensing requirements do you not care for in
Sql Server Express?

Andy

CCLeasing wrote:
Thanks but i don't know how to interface with databases in c# express.

I tried sometime ago to interface with a mysql database but got stuck
somewhere along the way. I don't want to use ms sql server because of
the licencing requirements.

Thanks, any further advice would be appreciated.
Nov 21 '06 #5
I understood that the database size was limited when i last looked into
this about a year ago. And didn't like the idea of having to pay if the
database happened to grow beyond the limit.

Also - It was my understanding that if i distributed programs that
utilised an sql database, each user would have to install sql server
express - and as this can be taken out of the public domain at any
time, i didn't think this was a viable option.

I'm sure i've missed the point somewhere along the way - please feel
free to to educate me!

Thankyou.

Nov 21 '06 #6
Thanks very much - i'll investage remoting further and try that route!

Nov 21 '06 #7
I've tried following a simple .net remoting starter. And the code isn't
compiling. Complaining that it doesn't know about the namespace HTTP.
Can anyone suggest why this isn't working?

The tutorial i'm using is here:
http://www.c-sharpcorner.com/Network/RemotingInNETM.asp

Excerpt: -

Step 1: Creating the Server Server.cs On Machine1
--------------------------------------------------------------------------------
I've coded the following file : -

using System;
using System.IO;
using System.Runtime. Remoting;
using System.Runtime. Remoting.Channe ls.HTTP;
namespace Server
{
public class ServiceClass : MarshalByRefObj ect {
public void AddMessage (String msg)
{
Console.WriteLi ne (msg);
}
}
public class ServerClass
{
public static void Main ()
{
HTTPChannel c = new HTTPChannel (1095);
ChannelServices .RegisterChanne l (c);
RemotingService s.RegisterWellK nownType
("Server","Serv er.ServiceClass ","ServiceClass ",WellKnownObje ctMode.Singleto n);
Console.WriteLi ne ("Server ON at 1095");
Console.WriteLi ne ("Press enter to stop the server...");
Console.ReadLin e ();
}
}
}
Save this file as Server.cs
Compile this file using

csc /r:system.runtim e.remoting.dll /r:system.dll Server.cs
-------------------------------------------------------------------------------------

When I try to compile it i get the message error CS0234 the type or
namespace name 'HTTP' does not exist in the namespace
'System.Runtime .Remoting.Chann els' (are you missing an assembly
reference?)

Any suggestions please?

Nov 21 '06 #8
Hi,

HTTP should be Http - it's case sensitive.

Also, there is a newsgroup that may help you with your remoting-specific
questions in the future:

news://news.microsoft.com/microsoft....ework.remoting

--
Dave Sexton

"CCLeasing" <ga**@ccleasing .co.ukwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
I've tried following a simple .net remoting starter. And the code isn't
compiling. Complaining that it doesn't know about the namespace HTTP.
Can anyone suggest why this isn't working?

The tutorial i'm using is here:
http://www.c-sharpcorner.com/Network/RemotingInNETM.asp

Excerpt: -

Step 1: Creating the Server Server.cs On Machine1
--------------------------------------------------------------------------------
I've coded the following file : -

using System;
using System.IO;
using System.Runtime. Remoting;
using System.Runtime. Remoting.Channe ls.HTTP;
namespace Server
{
public class ServiceClass : MarshalByRefObj ect {
public void AddMessage (String msg)
{
Console.WriteLi ne (msg);
}
}
public class ServerClass
{
public static void Main ()
{
HTTPChannel c = new HTTPChannel (1095);
ChannelServices .RegisterChanne l (c);
RemotingService s.RegisterWellK nownType
("Server","Serv er.ServiceClass ","ServiceClass ",WellKnownObje ctMode.Singleto n);
Console.WriteLi ne ("Server ON at 1095");
Console.WriteLi ne ("Press enter to stop the server...");
Console.ReadLin e ();
}
}
}
Save this file as Server.cs
Compile this file using

csc /r:system.runtim e.remoting.dll /r:system.dll Server.cs
-------------------------------------------------------------------------------------

When I try to compile it i get the message error CS0234 the type or
namespace name 'HTTP' does not exist in the namespace
'System.Runtime .Remoting.Chann els' (are you missing an assembly
reference?)

Any suggestions please?

Nov 21 '06 #9
Thanks very much - in future i will post in that group.

I have tried your change and now am getting a different error.

I now have: -

---
using System;
using System.IO;
using System.Runtime. Remoting;
using System.Runtime. Remoting.Channe ls.Http;
namespace Server
{
public class ServiceClass : MarshalByRefObj ect {
public void AddMessage (String msg)
{
Console.WriteLi ne (msg);
}
}
public class ServerClass
{
public static void Main ()
{
HttpChannel c = new HttpChannel (1095);
ChannelServices .RegisterChanne l (c);
RemotingService s.RegisterWellK nownType
("Server","Serv er.ServiceClass ","ServiceClass ",WellKnownObje ctMode.Singleto n);
Console.WriteLi ne ("Server ON at 1095");
Console.WriteLi ne ("Press enter to stop the server...");
Console.ReadLin e ();
}
}
}
===========
And am getting the error 'the name ChannelServices ' does not exist in
the current context.

And also System.Runtime. Remoting.Remoti ngServices does not contain a
defintion for RegisterWellKno wnType.
==============

Thanks Again-

Nov 21 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
50588
by: Alex Ang | last post by:
I have written the following VBScript program. It is stored into a file "map_drive.vbs". It successfully mapped to a network drive \\server1\data. Dim WshNetwork Set WshNetwork = WScript.CreateObject("WScript.Network") sPwd = inputbox("Enter password") WshNetwork.MapNetworkDrive "J:", "\\server1\data", false, "xyz_net\John", sPwd Msgbox "Drives has been map successful"
1
2243
by: Neel Word | last post by:
I need to develop an application (development platform: Win2000; target platform: Win98/ME/NT4/2000/XP), which would require file transfer functionality over dial-up and network. We could develop on .NET (1.1 or 1.0 - VS.NET 02/03) or using plain COM (visual c++). We'd prefer .NET though. Does anyone know of any products or COM API (or .NET classes) that can easily handle file transfer over dial-up
5
3661
by: Mike McIntyre [MVP] | last post by:
I am working on an issue where and ASP.NET web application on one computer (A) needs to access files on a network mapped drive (B). This application uses as DSN on (A) that maps a proprietory ODBC driver to data on a (B). The DSN directory path points to mapped network drive mounted on (A). When the ASP.NET application reaches the point where the ODBC drive is called to fill a DataSet it throws the following exeption:
5
3112
by: Dave Kolb | last post by:
Is there any other solution for an ASPNET application to access network resources other than running as SYSTEM, using delegation (a nightmare to get to work) or the COM+ solution? I cannot seem to impersonate a user and obtain network credentials using the DuplicateTokenEx call with appropriate parameters even though the call seems to not fail. I check my identity has changed but can only still do local commands. I would consider...
14
2323
by: frostalicious | last post by:
Used VB.NET (on my client PC) to convert VB6 executable to .NET executable. Placed the .exe file on a network drive on my server. From client, ran .NET Wizards "Trust an Assembly" to make the .exe (on the network drive, on the server) "Full Trust." From the client, double-click on the ..exe (on the network drive, on the server) and it runs fine. So far, so good, but... On the server, where I've installed not VB.NET but .NET
2
1533
by: mark | last post by:
Hi, I am in the process of developing a small application that sits in the task bar and at a set interval polls an IIS web server for information. The process involves the client sending anything between 3 and 30 characters of data and the server returning anything up to 50 characters of data. I need to identify the overhead on the network so I can determine the network utilisation of the application. The sort of questions I need to be...
15
1775
by: itschy | last post by:
Hi. I have a couple of nodes (just ids, no coordinates whatsoever) and links betweens them (weighted). Is there any existing solution to visualize this network in php? Thanks itschy
6
2308
by: Tony | last post by:
Hello! This is the scenarion that we want to implement. We have a computer called A which register itself on a superviser server about it's existence so other computer can get the identification about computer A. Now computer B wants to communicate with computer A so computer B ask the superviser server about the identification for computer A so B can start communicate with computer A.
4
2926
by: james457 | last post by:
Hi all, I am writing a linux testbed for wireless sensor networks. The core objective is to test data transfer between any two nodes. The network runs using tree topology. One node in the network is the "Driver". This node is connected using serial port to a linux PC. What I am trying to write is the software on this linux PC that will drive data transfer in the network. The "Driver" node, taking commands from the software running on...
0
9591
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10057
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9869
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.