|
Hi guys
This is the scenario of a remoting application .
I have a library named sales , in which there are three classes named CD,Books,Medicine, these classes are derived from class named Items and this items class is derived from an interface named Idomain and this interface have three properties
String name{get;set;},int code{Get;set;] , double price{get;set}, in items class these three properties are implemented. All classes are serializable also.
I have another interface named IappDomain which contains a method named
List<idomain> getitems();
Now here I have a class named Post which is derived from marshelbyref and also from
Previous defined interface named IappDomain, in this class I am implementing the getitems method of the IappDomain interface .
On my remoting server my wellknownservice type is Post, with wellknownobjecctmode.singlecall.
And on my client side I have a dll in which the Iappdomain interface resides,
But when I call the method getitems from this interface on my client side
I get an exception that sales dll is not found ,, why is that ?
Do I have to use object factory , I don’t want to put my sales library on the client side coz I have put the interface there , but why it asks for the sales dll,, kndly help me out,
Thanks in advance
hello
|
|
|
|
|
Here you can do two things to solve this issue. One thing is that you can add the Sales dll in ur client app, but you don't need that fix.
Another thing is that you can make the class Items derive from MarhsalByRef and make the return value of getitems() return list of Idomain.
The way you have done requires serialization of classes Items, CD, Books and Medicine objects in the list from server side, and require deserialization at client side, to deserialize it at client side requires the Sales.dll there.
|
|
|
|
|
thank you very much for you concideration,
here i have made some changes,
now i have created an interface named IDomain which contains all the previouls defined properties
and with the additional method named list<idomain> getitems();
ok,
now i have derived my items class with this interface plus marshlebyrefobj,ok
now it is working , coz i have put an assemnly on my clent which contains the Idomain interface.
but why it was not working previousl?
and another thing can u help me please i also have to publich this method through web service when i create and run web service method it says the interface named IDomain cannot be serialized
why is that?
thanks in advance
hello
|
|
|
|
|
Sorry Dude,
I am not that good at WebServices eventhough I had developed some webservices using PHP5. As far as I know, Webservices are state-less, what I think is you need to make ur classes serializable and return that instances of that classes from webservice method.
|
|
|
|
|
Hey,
I want to create a non-visual control (for example like the Timer control). I mean such a control which will not have the behavior of a container but rather be behavior to dock to the "control tray" (as the Timer does) if I drop it to a form. If I just derive my class from System.Windows.Forms.Control, it will be a normal visual control. Can anybody give me a hint, how to develop a non-visual control? Thanks a lot.
Best regards,
Tim
|
|
|
|
|
Derive from System.ComponentModel.Component.
|
|
|
|
|
Hey,
thanks a lot!!!
Regards,
Tim
Best regards,
Tim
|
|
|
|
|
Im making an app that works as a card game AI tester. Theres game class which pretty much does all the rule related stuff and which communicates with Player classes by calling their functions, giving them some info through parameters and these functions return the AI player's response. So there really are no events in the app and no waiting anywhere. Recently i had the idea of making a RealPlayer class which would also inherit Player class and to which game class would communicate just like to an AI player. But the realplayer would ofc have user input.
So here comes the problem:
ive got a class, its constructor creates a form. functions of this class, when called, should wait for user to input something on the form (press a button for example) and then perhaps make quick calculations and return a value. How to make code wait for an event?
(and i know about event handling but thts not really the case here, if i did that id have to rewrite all game class and put events everywhere and im wondering if perhaps theres a way around that)
|
|
|
|
|
bluefl4me wrote: and i know about event handling but thts not really the case here
Yes, it is. The code you want to run, needs to be in the event. At best, a flag needs to tell you that you are waiting, and be reset in the event.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
And how do I wait for the flag to change?
|
|
|
|
|
For example:
I have a wepage with
Input text field named 'A' where a number is entered
and a submit button.
On clicking the submit button action="foo.php" , the server returns 2 multiplied to the number entered in the textfield.
How can we automate this process?
i.e. can you please guide me in writing a C# code by which I can automatically send 100 requests to the server and get results(at least..the sending part)?
Please help.
Thankyou.
|
|
|
|
|
Use the HttpWebRequest class to send a request for "foo.php" with the same method as the form (usually POST), and the form data as text, e.g. "A=42".
---
single minded; short sighted; long gone;
|
|
|
|
|
how can we consult, access, manipulate and add meta data in c# ?
|
|
|
|
|
MetaData for what? The way you access metadata is different for different types of content. For instance, you use Reflection to access the properties of an assembly.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
In fact, we have an application developped with J2EE and I must develop an application with C# that does the same fonctionnalities.
the J2EE application uses the meta data to do some treatments and also add other meta data to the program (additional informations about classes needed for the development).
So, i'm searching some documents that explain how to access to the meta data of c# classes , how to manipulate them, and also how to add new meta data specific to my application.
If you know some documents, sites or refernces, please reply me, I will be very grateful.
thank you!
|
|
|
|
|
You need to google for reflection and c#. To give you a taster, suppose that you have a class called MyClass and that you want to know what the properties are, you can do the following:
Type classInfo = typeof(MyClass);
PropertyInfo[] pinfo = classInfo.GetProperties();
foreach (PropertyInfo pi in pinfo)
{
Console.WriteLine(pinfo.Name);
}
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Greetings,
I'm working on a web application with a dynamically creation of a gridview and within this gridview a dropdownlist (ddl) for data validation;
Everything needs to be programmed dynamically in c# code.
The creation of the grid + data is very easy, but on 1 field I want a ddl, so that people can only choose from certain data in this ddl.
//GridView GridView2 = new GridView();
GridView2.ID = "Ellende";
GridView2.AutoGenerateColumns = false;
//GridView1.DataKeyNames = new string[] { "EmployeeID" };
GridView2.AllowPaging = true;
GridView2.AllowSorting = true;
GridView2.PageSize = 5;
BoundField bfName = new BoundField();
BoundField bf1 = new BoundField();
BoundField bf2 = new BoundField();
CommandField cf = new CommandField();
cf.ButtonType = ButtonType.Button;
cf.ShowCancelButton = true;
cf.ShowSelectButton = true;
bf1.DataField = "Task1";
bf1.HeaderText = "Task1";
TemplateField tf1 = new TemplateField();
tf1.HeaderText = "Task1";
DropDownList dl1 = new DropDownList();
dl1.DataSource = ObjectDataSource3;
dl1.DataValueField = "Recid";
dl1.DataTextField = "Status";
dl1.SelectedValue = "Task1";
GridView2.Controls.Add(dl1);
GridView2.Columns.Add(tf1);
//GridView2.Columns.Add(bf1);
bfName.HeaderText = "Employee Name";
bfName.DataField = "Name";
bfName.ReadOnly = true;
bf2.HeaderText = "Task2";
bf2.DataField = "Task2";
bf2.ReadOnly = true;
GridView2.Columns.Add(cf);
GridView2.Columns.Add(bfName);
//GridView2.Columns.Add(bf1);
GridView2.Columns.Add(bf2);
GridView2.Columns.Add(bf3);
GridView2.DataSource = DT;
GridView2.Visible = true;
GridView2.DataBind();
The main problem is that under "Task1" I need to connect the dropdownlist somehow to the gridview when using c# code dynamically.
I found out that I need a templatefield.
The gridview is filled with data when using a dataset--> that easy.
But the field with "Task1" needs to be connected with a ddl, from which a choice can be made.
When choosing a value from the ddl --> this value needs to be stored in the datatable DT.
How can I connect a DDL (with predefined data) in a gridview????
I hope somebody has an answer in c# or VB
Greetings Peter Bellen
bellenp@schneider.com
|
|
|
|
|
First off can you mention what a DDL is, as far as I know because I haven't done much web development it stands for Data Definition Language.
Secondly this might be better answered in the ASP.NET[^] or Web Development [^] forums.
|
|
|
|
|
Hi,
i want to send some emails in c#. I found some information about the smtp client class and I've implemented it. I want to use the gmail-Smtp Server. The gmail guys publicate on their page that you need a TLS encryption.
How can I use a TLS encryption in C#?
Thanks
spotl
|
|
|
|
|
There's a flag you set in the SmtpClient class, something along the lines of EnableSSL .
|
|
|
|
|
I've built a fairly simple windows service and tried installing it on my local machine via both installutil.exe as well as a setup/deployment project. Both types of installation indicate a successful install, however, the service is not listed in the list of services on my machine.
I've searched Google, etc to no avail....any tips or things I should be looking for?
Thanks a million,
Brent
|
|
|
|
|
I would guess that perhaps you are looking for the wrong name. The only other option is that installutil was not successful in installing the service. On your ServiceInstaller there is a SErviceName
ServiceInstaller.ServiceName
This must have the name of your service for it to show up.
Here is an article I wrote that has some sort code with a window service in it.
http://www.codeproject.com/dotnet/OpenFiles.asp[^]
Hope that helps.
Ben
|
|
|
|
|
i m using a hash table taking a string as a key and an arraylist object as a value .. each time the arraylist value changes for the second and further entries in the hashtable all the values of the hashtable changes according to the new entry in the arraylist i.e in the end all the different keys hav the same value pair that is the last entry in the array list y is it replacing the previous values of the hashtable arraylist once its been added to the hashtable
|
|
|
|
|
ArrayLists are reference types so by default variables are simply pointers to the same object in memory, so what you're storing is a pointer to the same array. What you want to look into is the Clone method which will return a copy of the array list, this should fix your problem.
|
|
|
|
|
Thanks A BUNCH .... u really did help me a lot thanks a lot .. i was working on it for 2 weeks thanks again
|
|
|
|