|
Hi.
Thanks for your help. this worked exactly as you said, but i do have a queston.
Can you explain what the
(CheckBox)sender
is specifying? also, can i use this for a textbox, or other controls, as well? for example,
TextBox tb = (TextBox)sender;
I'm new at this stuff, can't you tell?
Thanks again.
.gonad.
|
|
|
|
|
First parameter (sender ) of event handler is affected object.
it is passed as object so you need to cast it to correct type (Button / CheckBox etc..).
So when you have event handler for Button, sender is button user clicked on. If you have event handler for TextBox, sender is this TextBox.
i'm only pointer to myself
|
|
|
|
|
I create tables called "Employers", "Employees". One employer can have many Employees, but one employee can have only one employer.
In my code: I create EmployerClass
{
public Long EmployerID;
public EmployeeCollections Employees;
....
}
I want the EmployeeCollections can have a group of employees order by last name and first name. I can access it like Employees[i](int i) or Employees[name](string name = lastname+" "+firstname).
Can anyone please tell me how to do that?
Thanks in advance!
|
|
|
|
|
I want to populate a winforms treeview control from a relational table without xml in c#.net. I am new to c#, so please bear with me. I set up the oracle connection, dataadapter, fill etc. The code is given below.
My problem is that I have put messagebox and see that
this.treeView1.Nodes.Add(nodeAuthor); seems to add the nodes, but when the program completes and displays the form, I do not see the group_desc populated at all. I did not add anything manually in the Nodes property in Treeview. Please help!!!
this.treeView1 = new System.Windows.Forms.TreeView();
this.oracleConnection1 = new System.Data.OracleClient.OracleConnection();
this.oracleDataAdapter1 = new System.Data.OracleClient.OracleDataAdapter();
this.oracleConnection1.ConnectionString = "the connection strings"; string strSQLAuthors = "SELECT GROUP_MASTER.GROUP_DESC " +
" FROM " +
"GROUP_MASTER ORDER BY GROUP_MASTER.GROUP_DESC ";
TreeNode nodeAuthor;
DataSet ds;
//Create the Connection and the DataSet object, and then open the connection.
ds = new DataSet();
oracleConnection1.Open();
oracleDataAdapter1 = new OracleDataAdapter(strSQLAuthors, oracleConnection1);
oracleDataAdapter1.Fill(ds, "GROUP_MASTER");
//Populate the TreeView from the DataSet.
foreach (DataRow rowAuthor in ds.Tables["GROUP_MASTER"].Rows)
{
nodeAuthor = new TreeNode();
nodeAuthor.Text = rowAuthor["GROUP_DESC"].ToString();
this.treeView1.Nodes.Add(nodeAuthor);
}
//Clean up.
ds.Dispose();
oracleDataAdapter1.Dispose(); oracleConnection1.Close();
oracleConnection1.Dispose();
ram
|
|
|
|
|
Hi,
I want to format several edit boxes, one to show the "." for currency, another one to enter phones number with an +XX-XX-XX-XX, it's possible to do that in an easy way ? ( control, input an output).
Friend of mine say... should be... I can make it with VBA for Ms Access... it should be possible an easy with C#...
|
|
|
|
|
I just submitted a new article that converts my Validating Edit Controls[^] code to C#. Hopefully it will be published soon, but I can email it to you if you need it right away.
Regards,
Alvaro
Hey! It compiles! Ship it.
|
|
|
|
|
Hey That was just what I was looking for !!!! Thanks a lot !!
Braulio
PS.: Alvaro Mendez, con este nombre me parece que hablas español no ? yo soy de Málaga (España)
|
|
|
|
|
You're welcome Braulio, I just sent it your way.
PS. Si, hablo español (mejor que lo escribo). Naci en Cuba y radico en el sur de la Florida (USA).
Saludos,
Alvaro
Hey! It compiles! Ship it.
|
|
|
|
|
Sorry, I forgot to ask you to send me the article ( you can send it to bdiez@holtegroup.com ).
Thanks for your help
Braulio
|
|
|
|
|
Hello,
I apologize if this has already been discussed, but I need to find an solution for this problem. I have several web services that I have developed, and deployed to my staging and production environments. The problem is whenever I test the web services by specifying the .asmx file, type in the parameters into the form, and click submit, the new window opens for the web service, but the port number is automatically input into the URL. This causes a time out because the service cannot be found when the port number is specified. I need to know how to set up my web services/servers to not specify the port number. If I type the URL into the address bar, without the port, the web service funtions correctly.
|
|
|
|
|
Hi all, I have been battling to send packets ( custom structures in my case ) over TCP. What is the best way to do this. Sending text is a breeze, but trying to send packaged info is proving to be a problem.
Any help welcome, thanks
|
|
|
|
|
Why dont you try Remoting (it has a TCP channel option)? And you can send entire objects across the network.
HTH
Smitha
You are never given a wish without also being given the power to make it true. You may have to work for it, however.
-- Richard Bach
|
|
|
|
|
I shall have a look at it, thanks
|
|
|
|
|
hi, id like to know how to code for a button on a splash window, the button is an ok button..when clicked opens the main menu window...at this moment i've done this :
private button OK_CLICK (and so on......)
{
Application.Run(new MainMenu());
}
but this code is giving me errors..
is there any other way...the correct way....im new to C#...
thx alot
15 Yr old
|
|
|
|
|
If your splash dialog is started by a Main routine,
and your MainMenu is just a form, then you should code your button like this:
<br />
MainMenu mm = new MainMenu(this);<br />
mm.ShowDialog();<br />
the MainMenu will then be displayed as a modal dialog (i.e. the user can't interact with
the original dialog -the splash screen- until (s)he closes the MainMenu).
I'm not sure how you can then close the splash form, but that's a start, I hope.
F.O.R.
|
|
|
|
|
Hi all,
I have two applications in seperate projects, one a client and one a server, I have created a Request object which is identical in each application and am serializing it and sending it through sockets and attempting to deserialize it at the other end, but when I try formatter.Deserialize(byteData) it errors (see exception at end of post), for some reason when the client attempts to deserialize the request object it trys to find the server application..I have no idea why this is and am completely stumped.
Can anyone help? If you need any additional information let me know and I'll post it here.
Thanks in advance.
Matt
The Exception in question
=========================
System.Runtime.Serialization.SerializationException: Cannot find the assembly AgencyManagerServer, Version=1.0.1354.16670, Culture=neutral, PublicKeyToken=null.
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at Client_Application_Test.Form1.Deserialize(Byte[] data) in c:\documents and settings\matt\my documents\visual studio projects\client application test\form1.cs:line 214
|
|
|
|
|
>I have created a Request object which is identical in each application
so do you have two classes of this request-object?
one in the server-app and one in the client-app
or do you use a shared dll?
|
|
|
|
|
Yes I had the class on both sides, but I've done some reading on msdn and found that serializing an object records the assembly name to deserialize it again, which is why I was having the error, since it was going from Server to Client assemblies, so I've put the request/response objects in a shared .dll file to resolve the problem. seems to work fine
Thanks for replying
|
|
|
|
|
Is there any way to use a class from a dll? or do i have to use a StructLayout?
|
|
|
|
|
On C#, AFAIK, it would be too much trouble. The easiest way would be using Managed C++ and writing a simple wrapper __gc class, which would be easily callable from C# and can natively call your dll. You can find some samples for that on the Web.
You can do it on anything you choose - from .bat to .net - A customer
|
|
|
|
|
could you give me a little more direction on where exactly to find a decent example?
|
|
|
|
|
Here:
http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=wrap+unmanaged++__gc+sample
You can do it on anything you choose - from .bat to .net - A customer
|
|
|
|
|
I'm looking for a simple way to lauch Windows Explorer from C# and have it open up to a given folder. What I DONT want is to have a black command prompt window to flash up on the screen briefly while it executes a command line (I really hate that, and it confuses users).
I've looked through some WMI articles, but they seem overly complex for what I'm trying to do. Any suggestions?
-- James --
|
|
|
|
|
System.Diagnostics.Process.Start(@"C:\WINDOWS\EXPLORER.EXE /n,/e,C:\");
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
hi,
anyone can give me some tutorials about the deployment tools in Visual Studio .NET?
i seems able to do more than my current understanding.
would anyone give me some help on that?
thanks,
jim
|
|
|
|