Answer Questions
JollyDMan Tree control to display the data form a database table in hierarchy
Hi all I want a table "Employees" with fields like EmployeeID, Name, CompanyID, DepartmentID Now what I want is to show data in a hierarchy like +Company + Departments +Employees how can use the tree view contro to do that. can any one suggest something Anyone got an example hi, i have did something like that using dataviews from my dataset addi ...Show All
Bozer Help to column cell width?
Hello Here is a piece of my code in Visual C# 2003. private void listBox2_SelectedIndexChanged(object sender, System.EventArgs e) { foreach(Object o in listBox2.SelectedItems) { //My conn string works but is not here in the example string navn = listBox2.GetItemText(o); string query = "SELECT a_navn AS Navn FROM ansat WHERE a_navn LIKE '"+navn+"'"; MySqlDataAdapter adapter = new MySqlDataAdapter(query,conn); DataSe ...Show All
Hems4all Design of 'this'
Hi All, I seek a clarification in the design of the 'this' keyword in C#. Let us consider this bit of code- class Test { public Test() { Test t1 = this ; } } This is fair enough,it works-memory for the instance of Test has been created and Test1 has been made to point to the current instance.Fine Contrast the above to the following code class Test { Test t1 = this ; public Test() ...Show All
Mario Queiroz Shrinking "if" statment
Hi All, I wonder if any one know how to Shrink "if" statment. like we can do if function ( the plus / minus sign in the left side ). It's make me crazy, because I have a lot of lines of code inside the bracket. AND if this option is exist , it's will be very useful. I don't want to use the #region Options. Please Help BOAZ. I am not sure if I understand what you mean by ...Show All
mgraul How to serialize unexpected complex type contained in class being serialized.
Hello, hope you can help me, I can't get instances of SomeNode serialized using the XmlSerializer() public class SomeNode { public object Data = new CustomDataType(); } public class CustomDataType { ... } I'm trying to have a serializable tree-arranged collection of nodes, each node can hold an object instance of custom type (similar to the TreeNode.Tag p ...Show All
DWhobrey How to convert 2003 win from code to 2005 with partial?
Hi, all. I have a window application written by VS.NET 2003. I opened it with VS.NET 2005 and convert the app. However it doesn't convert the structure of each class code. I like the seperated classes intruduced in VS.NET2005, which seperates form design code from custome code. Is there any tool or way to convert my old 2003 style form coding to 2005 style code seperating design and custome codes Thanks to Mohamed ...Show All
Gangadhar Urgent:How to write a message in C#
Hello: How can we write this using c# When the fullpath contains atleast one space, the user is required to include double quotes. IF the fullpath has no space, user is not required to use double quotes (but they can). The message that has to be displayed eventually with the above is "failed to load file" the path is: c:\Test ABC\Elite_Dms_SystemSetting.xml One solution would be that you ad ...Show All
Jaya Rayasam vs 2005 not responding
I am using VS.Net2005. Whenever I open a project, the VS gets stuck. If I end the vshost process, the VS continues to respond (but I cannot debug the app). The same happens when I create a new project, so it is not a project specific issue. Does anyone know how to solve the problem thanks. I am afraid that the problem is not solved. I uninstall all add-ons (and any unused application), and tried to re-instal ...Show All
Jocke Intellibis Operator + in strings
string path = "C:\\Documents and Settings\\"+ LogonName +"\\Recent"; Error 1 Operator '+' cannot be applied to operands of type 'string' and 'method group' What do i have to do Thanks, Guilherme Try changing it to this: private string LogonName() { RegistryKey rkey = Registry.CurrentUser; RegistryKey rkey1 = rkey.OpenSubKey( "SOFTWARE\\Microsoft\\Windows\\C ...Show All
AGervais Abort a Thread
hello, i have a problem that i really dont understand !!,, i cant abort a thread, my app get frozen... i have this function: socket is my Socket tcpListeer is a TcpListener listening is a bool listen is a Thread private void StartListening() { socket = null ; tcpListener = null ; tcpListener = new TcpListener(IPAddress.Any, port); try { tcpListener.Start(); listening = true ; lb ...Show All
Toldin DateTime Method
Ok. I know I have asked this question before, but I wanted to ask it in a different light. Here is a sample code that I dont know what to do with : double seconds = 0; DateTime baseTime = new DateTime (); DateTime date = baseTime.AddMilliseconds(seconds); Ok, what I want is for the current time to be "00:00:00". And for it to show the incrementing seconds. Can anyone tell me how to do this. If you need more clerification please ...Show All
courtz Logging Feature w/o passing a streamwriter
I have written a program with several classes, and several methods that objects of each class performs. Now, I want to create a detailed logging feature, that will produce a single text file each time the program runs. I want to be able to add log entries from any method in any class in the program. What I don't want to do is, for each entry, open the file, write the entry, flush, and close the file. I also don't want to pass a streamwriter to ...Show All
E Ingram How to global a variable in C#?
Hello! How can I "global" a variable in C# Thank you! Thank you David, I didn't know that I had to specify it but I need to have a "global" variable that need to be processed ; the code you gave me is a class and doesn't allow "regular code" in it. I tried creating a new function in it but it doesn't work, it may be because I don't know how to (I've searched and found nothing!). I am new to C# (being coding PH ...Show All
Janikocjan Treeview Mimicking Windows Explorer
I am implementing a TreeView control to closely mimic Windows Explorer behaviour. The user can edit labels and these must be uniquely named. If the user edits the name of the label to a non-unique name an error message is displayed and the label remains in edit mode until the user enters a valid name. I am using the following pattern within OnAfterLabelEdit: protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e) { //Label ...Show All
Robert W. Anderson Help me to understand better the interfaces
Hi i read a bunch of articles on articles.. i know exactly how to amke them.. But i dont understand why should i use them .. or for what are they important.. Why should someone wanna make a interface for something... Please help!!! You want to use a compiler Can you explain a little more I don't understand why you need to make some compiler interface. When you have a Ball interface: public interface IBall { double GetSize( ...Show All
