Answer Questions
Ethan Pack How do you REMOVE or DELETE Items from Recent Projects list in VS2005 RC?
I have been testing VS2005 RC and as a result, I have built many applications. Most I am no longer interested in or use and would like to DELETE them from the RECENT Projects list, but I dont see how ! I have been achieving this by manualy deleting the project from IIS, but there's got to be a better way ! Any ideas cheers, yousaid One way I discovered are to remove the project directory from the [yourPath]\Visual Studio 2005 \ Projects \ Then when you try to open the project in the recent project list, visual studio can't find it and ask you if visual studio can remove it from the recent list ps. I use VS 2005 Beta2 /R This post is also provided "As-is". No warranties are expressed or i ...Show All
amygal Running Task Manager -Problems-
Hey i am having trouble accesing my task manager when i press the ctrl+alt+del buttons nothing pops up. I have tried to access the task manager via control panel but it still does not work, giving me an error that reads some nonsense about the file being in use. I have tried the regedit option and it does not work and i am hoping the a system restore will be my last resort. Please help me. This question has nothing to do with the C# IDE and so is off topic in this forum. It also has nothing to do with programming, which makes it off topic in all these forums. CTRL-Shift-ESC is how you bring up the task manager. But, it sounds like you've got issues. You just need to find a hardware focused forum to find help. ...Show All
Tall Dude Retrieving last index value in an ArrayList
I want to populate an int variable with the last index of an ArrayList. I haven't yet found a property of ArrayList that will do that for me and I'm wondering if I'm missing something. Right now I am doing it this way: int theLastIndex = theArrayList.Count - 1 But I'm wondering if there is a more elegant way. This is in C#, by the way. Thanks in advance. Sorry, but that won't work at all. If that even could compile, it would set the lastIndex value to theArrayList.Count and then increment theArrayList.Count. However, Count is read-only, since it doesn't make sense to increase the number of items without actually adding an item. Yes, that is correct. Nor ...Show All
asalcedo Wrong Empty string convertion
Hi, I have a wierd issue in my C# code. When I update a field in an XML file with a empty string, the field is actually updated with "\r\n " I try several things like String.Empty but nothing is working correctly. Does anybody have a clue how to resolve this Thanks, Bertrand Hi Michael, I actually believe that the core problem is when the Xml file is saved. My code is XmlNodeList elemList17 = doc.GetElementsByTagName( "Machine" ); elemList17[0].InnerText = ( String .IsNullOrEmpty( this .SEMachineID.Text) string .Empty : this .SEMachineID .Text); /// there the text is OK "" doc.Save(filename); after the saving, it is now "\r\n ". Why Hi, ...Show All
xRuntime About returning @@Identity
I have written the following typical code for updating a datatable: private static bool UpdateExtraInfo(int intItemID, DataTable dtExtraInfo, SqlTransaction myTransaction) { // Create a SqlDataAdapter, and dispose of it after we are done SqlDataAdapter dataAdapter = new SqlDataAdapter(); try { &nbs ...Show All
Cest la vie Why can't attribute parameters be dynamic?
I was looking at decorating a method with the PrincipalPermission attribute. It tried to do this: protected static string foo = "bar"; [PrincipalPermission(SecurityAction.Demand, Role = foo )] public void DoSomething() { } But it doesn't compile: "An attribute argument must be a constant expression, typeof expression or array creation expression" What the technical reason for this and do you think it would be good feature to have this, or better to leave it as it is I would be very interested in hearing your opinions on this, thanks! I you think of Attributes as comments that compile I think you will see why this is not allowed. My bad The value of t ...Show All
selva_kumar Mathematical question !!
Hello, Can any one sort this complexity from worst to good O(k) O(k n) O(k n2) O(k 2 n ) O(k log n) O(k (log n) 2 ) Thanks a lot why looks like a homework Why would you have a long list of specific O() expressions, unless it was an assignment Why would you have a specific task to do with them, unless it was an assignment If you'd asked "Which is better, O(2^n) or O(n^2) " then we might have thought that you might have come upon the question naturally, in your own work. But under self-study conditions, by the time you had a full list of O() expressions to wonder about, you would have known how to answer the question. Hence, the only logical assumption was that you were give ...Show All
imj Correct me if I'm wrong...
[Reposted from .NET forum] I have an issue and I wonder if anyone has run into this. As I know, you cannot call virtual methods from within constructors safely, because the inherited class is not constructed at the time of base constructor invocation. However, I am creating a base class whose internal workings are sufficiently complex that I had to create a series of virtual functions that the inheritors can modify. These are called when a particular property is set in order to set up the connective tissue underneath. This is not a problem. The problem exists because I cannot use these same virtual calls on either deserialization constructors or in the default constructor to perform these same operations when the class is first in ...Show All
WillRogers How can I make a method wait for a certain number of seconds?
I have a method that fires on Main_Load. I want it to wait for a certain time before it fires. How can I do this Thanks, I usually accomplish this end by using Thread.Sleep(int milliseconds). Just include System.Threading. But I think it suspends the current thread, so it might not be feasible for you to use it. If you're waiting for some event to be fired, you can probably implement the solution given above. If it is a single-threaded application and you just have to wait for a certain time-period after which, say, a certain resource becomes available (I had to use it for reading SerialPort), then its a simple and effective solution. Smiles. The easy way: Place a Timer control on the form and set its Interval proper ...Show All
game-maniac How do i call a method from a different form?
Hi, I have 2 forms that are closely linked with each other: form1. a form which lists a bunch of different layers form2. a form which describes the layer (i.e. name, colour, etc) if i change something in form1, i want to call an update function in to update the display in form2, and vice versa. What is the best way to do this from my knowledge, using delegate only works in one direction, correct me if i'm wrong. My idea is to create the update functions within their respective classes and find some way to call that function from the other form. is that possible i have already set it up so that they are sharing a data structure, i just need them to access each other's functions. thanks. ...Show All
TheChad33 Application - Properties: An error occurred trying to load the page.
Hi All, I was doing a tutorial when i noticed that if I right clicked on my application and selected 'properties,' the properties menu gave me a strange error - 'An error occurred trying to load the page. Exception has been thrown by the target of an invocation.' I have taken a screenshot and placed it at http://members.iinet.net.au/~yimr/error.jpg I tried creating a new document and it still gives me the same error except if I try it in Visual Basic Express the properties page works. Does anybody know what is wrong I reinstalled Visual C# but it did not fix the problem Thx! Diamondplane thanks for your help, but I actually tried it with a few different 'new project' templates and it still di ...Show All
.Net Queen How to use AddEventHandler?
Hi I am trying to use reflection to bind the same event handler to different events. I can't figure out why I can bind the eventhandler with += but not with reflection AddEventHandler - see the example below. Does anyone have a clue as to what am doing wrong Rgds Bertrand class form1 : form { public void myEventHandler( object o, EventArgs e) { /*...*/ } public void button1_click(...) { /* The following works: */ this.FormClosing += myEventHandler; /* Why does the following not work */ Type objectType = Type .GetType( "myNameSpace.Form1" ); EventInfo objectEventInfo = objectType.GetEvent( "FormClosing" ); Type objectEventHandlerType = objectEventInfo.EventH ...Show All
Leo Kent Drawing ellipses question
I am drawing a yellow circle but realized I have a problem with it. Graphics g = e.Graphics; Pen yellow = new Pen(Color.Yellow, 3); g.DrawEllipse(yellow, 100, 50, 100, 60); I thought that this was centering the circle in the form at (100,50) while making it's horizontal diameter 100 and it's vertical diamater 60, but I am not sure if this is correct. It appears from what I have read is that the int x, int y positions are for the beginning of the rectangle that forms the bounds of this ellipse. Does this mean that this is the center of my circle or just like drawing a rectangle, it is the beginning from the top left location I want my ellipse centered at 100,50. Is this right What should it look like if it's not ...Show All
QuantumMischief Iterations through a Dataset/datagrid
I am new to C# and dataset/datagrid processing. When saving any changes, I need to know how to iterate through changed rows to evaluate column contents for validation. The information I have at my disposal does not show any examples. Any help would be greatly appreciated. The part DataTable theModifiedCollection = theDataSet.Tables[0].GetChanges(DataRowState.Modified); I was aware of. But where I am stuck is once I get the modified rows, I need to validate each one of them, I suppose through a loop. I need to know how to reference the row/column of each of the rows deteremined in the statement above. Thanks No error, it is just that it does not ...Show All
soung BackgroundWorker
Hi, I got a while loop which makes the Form act slow. I got advised to use a backgroundWorker. Yesterday i read on the msdn library what it is and how it kinda works. Unfortunately, i didn't figure it all out. I was hoping you guys might wanna help me out. This is my while loop: this.formBreakLoop = false; while (!this.formBreakLoop) { int numberChosen = rnd.Next(0, words.Length - 1); this.lblDisplayWord.Text = words[numberChosen].ToString(); this.lblDisplayWord.Update(); Application.DoEvents(); Thread.Sleep(4500); this.lblDisplayWord.Text = string.Empty; this.lblDisplayWord.Update(); Thread.Sleep(500); } //constructor public Form3() { InitializeComponent(); InitializeB ...Show All
