FannwongCindy's Q&A profile
Visual C# who catches explicity thrown exception ?
I have a question about the usage of throw in the following code I found on msdn. In this code, an excpetion is caught using try catch block and in the catch block it is rethrown using an explicit throw statement. My question is that who handles the explicitly thrown exception The same catch if this is the case then the compiler will be trapped infinitely inside the catch block. using System; using System.IO; public class ProcessFile { public static void Main() { FileStream fs = null ; try //Opens a text tile. { fs = new FileStream("data.txt", FileMode.Open); StreamReader sr = new StreamReader(fs); string line; //A value is read from the file and output to the console. line = sr.ReadLine(); Console.Wr ...Show All
SQL Server Populate a variable
During a dataflow - I like to populate a variable with True or False based on a value in one of the data records. How do I do this excercise if I use a script - can someone provide me with simple script on how to populate one variable Thanks heaps Thanks for answer but not sure I can get it to work. Let me be more specific. I got one record in my table and the "colunm name" can either be "Y" or "N". However I like to convert this Value into my variable "Verify" So if "colunm name" is "Y" => Verify = TRUE if "colunm name" is "N" => Verify = ...Show All
.NET Development Why doesn't System.Array have an indexer?
I'm probably missing something here, because my all of my searches came up with nothing. It seems only natural for Array to have an indexer. But instead, we have to use Get/Set Value(). Why is that Note how GetValue() peters out beyond 3 dimensions and gets very inefficient after that, requiring passing passing a array of indexes. I can think of only a few reasons why System.Array wasn't declared abstract. CreateInstance() for non-zero lower bounds perhaps... ...Show All
Visual Studio Team System Webdav webtest not simulating file copy or upload
I created a webtest script that is attempting to simulate a file copy/download to a webdav directory. Although the script passes when run, no files are actually copied to the server. I started with a Fiddler session, then recorded my webdav actions using IE6. I then saved the Fiddler session as a *.webtest and imported the test into my VSTS project. I can see the binary information for the .txt file I am attempting to copy in the execution log (under the Request tab) for the test script. However after running the script, the test.txt file used for the test script was not copied to the webdav directory. Any thoughts Here is the request: POST /atlas_webdav/Trial%20Account%20for%20test/UploadTest/test.txt HTTP/1.1 Content-Language : en-us ...Show All
Visual Studio Sandcastle - Please consider allowing richer formatting in documentation
Hi there, I've seen the developers behind Sandcastle seem to be very active here so I thought I may make a request - something I'm sure is wanted by others (albeit perhaps indirectly). My employer is considering enforcing a set format for comments for each class with this information. Class Name (covered implicitly by Sandcastle) Description (covered by <summary>) Date Created Authors (possibly list) Revision Table with these headings Date of change Issue reference number Developer whom made change Reviewer of change Summary sentence of change made I've argued for the fact that these things should be covered by the source repository - and they've agreed but want this stuff at the top of class headers too - as we are curre ...Show All
Visual Studio Team System Multiple Problems in Same Class?
Hi, I have a rule where I want to return multiple Problems for the same class. Adding new Problem instances to the Problem collection is allowed, however only ONE problem is ever reported. For example, given the following rule: public override ProblemCollection Check( Class c) { Problems.Add( new Problem (GetResolution( "Problem 1" ))); Problems.Add( new Problem (GetResolution( "Problem 2" ))); Problems.Add( new Problem (GetResolution( "Problem 3" ))); return Problems; } The output is only ever "Problem 1" for each class. Is this a known issue Thanks, Duncan Dunca ...Show All
SQL Server Between + '%'
helloo I have this table Id Code -- -------- 1 10101001 2 10101002 3 10102001 4 10102002 5 60101001 6 60101002 7 60102001 8 60102002 9 60201001 10 60201002 11 70101001 12 70101002 I need to query this table by the following (select id, code from table1 where code between '1' + '%' and '7' +'%') to get all values of codes between (code starting with 1) and (code starting with 7) or for example: (select id, code from table1 where code between '602' + '%' and '7' +'%') ------------------------------------------------------------------------- Im not getting correct answers or let be specific in the second query im not getting codes starting with 7, im only getting codes >= 602 but less that 7, so 7 is not incl ...Show All
.NET Development Handle simultaneous access to database
I am making an application which will be running on serval pcs and access same database simultaneously. It makes more than one database access at a time on any single pc. I need one of the access thread to get data from a data resouce and write the new data into the database to replace the old one. when this thread is getting and writing data to my database for an item, other threads accessing that item must wait till it finishes writing. The accessing threads are generated at runtime and the number of them is vary from time to time. The pcs do not have knowledge to each other and there isn't any other machine or application working as a center to control the database access. The pcs probably will work on the same network. but, th ...Show All
Visual Studio 2008 (Pre-release) Executing Commands from *any* event
I understand that commands can be triggered off certain events of certain controls. For example, specifying a Command for a Button will trigger it off the Click event. But what if I wanted to trigger a command off of a different event -- like a Load event Is there a way to do this at all If so, can I do it from XAML only Done, the tool is scheduled for the WPF Toolbelt CTP 2 release scheduled for the end of August. If the class is available prior to the official release date (through a code commit) I will let you know here. If you'd like to follow the project, you can go here ...Show All
.NET Development XmlNode.ChildNodes[index] bad performance
Hello, I'm using XmlNode.ChildNodes[index] function to access a node by index, and it causes a performance problem. Is there a better way to access a node by index Thanks, Can you provide some details such as which .NET version you are using, how many child nodes there are when you get performance problems Also to think about better ways it might help us what kind of nodes you are looking for If you are really interested in all kind of child nodes based on the index then there are probably no changes possible. On the other hand if you are for instance only looking for element child nodes then using XPath and e.g. SelectSingleNode might provide an alternative way where you could then check whether it performance better ...Show All
Visual FoxPro slipstream VFP 9 with SP1 ?
Anyone know how to slipstreaming Visual FoxPro 9 with current SP1 Sure: copy the VFP CD to a writeable drive, use WinZip to extract the MSP file from the SP1 installation, then run this command (allowing for different file paths) to update the installation directory: msiexec /a c:\vfoxpro9.0\vs_setup.msi /p c:\temp\VFP9.0sp1-KB909149-X86-Enu.msp I just tested an install and it seemed to work just fine. (I had to type in the product key for VFP9 though) Regards Stuart Dunkeld ...Show All
.NET Development How to make a Vb.Net application trigger another one on a different machine on the net
I need advise on how to make a Vb.Net application trigger another one on a different machine on the net,i will be provided the ip of the destination machine. Thanks in Advance Maju Hi Jared Thnx for your reply.... My reqmnt is to wake up a service if itz dead on a remote mach,the service is a Microsoft appln..so i plan to create two vb.net applns (one for the server and one for the remote machines) and i will be provided the ips of all.And i think to start my client appln by the help of the server one to check the status of the microsoft appln and wakeit up if reqd.(i need a server n client vb.ne ...Show All
SQL Server flat files without column names; how to map over 250 columns
hi, i am sure this question must have been anwsered some where, but after a lot of searching i still have not find the anwser. i have flat files without column headers (267 columns in total). since i have the file's description i have created a table to house these extracts with the columns in the same order as in the flat files. additionally, i have an excel containing a list of the column names their data types and length as well as their position on the flat files. in the old, DTS would map the columns without headers to those columns in the destination table using their order, in which case it works like a breeze for me. but i can not find a way of doing that in SSIS. i would very much appreciate someone's assistance on this one since ...Show All
Visual C++ time accuracy
I have this program to chk time, but the accuracy is 2 sec. I want more accuracy ( 1 sec or less ) pls help , thanks #include <io.h> #include <iostream.h> #include <conio.h> #include <windows.h> int main(void) { FILE *stream; std::ftime ft; int h,m,s,ms; if ((stream = fopen("TEST.$$$","wt")) == NULL) { fprintf(stderr, "Cannot open output file.\n"); return 1; } getftime(fileno(stream), &ft); h=ft.ft_hour; m=ft.ft_min; s=ft.ft_tsec; printf("File time: %u:%u:%u\n",h,m,s); printf("File date: %u/%u/%u\n", ft.ft_month, ft.ft_day,ft.ft_year+1980); fclose(stream); cout << "\n\nPress any key to continue"; getch(); // wait for key pressure return 0; } ...Show All
Visual Basic Clearing all TextBoxes on a TabPage
I want to write a small routine to clear all text boxes on the presently opened TabPage. Please help. I am using VB.NET 2003. K.Rohit wrote: Paul, It is not clearing the TextBoxes. It sounds like you might have TextBox controls nested within other controls. Try this snippet Dim toVisit As New List(Of Control) toVisit.Add(Me) Do Until (toVisit.Count = 0) Dim cur As Control = toVisit(0) toVisit.RemoveAt(0) For Each child As Control In cur.Controls toVisit.Add(child) Next Dim tb As TextBox = TryCast(cur, TextBox) If tb IsNot Nothing Then tb.Text = String.Empty End If Loop Let me know if that works ...Show All
