bennett_chen's Q&A profile
.NET Development Parsing double value from a string
Hi all, I need to parse a string which is in the following format (example): -0.0004 USD/Tonnes Basically, it will be a double value, might be preceded by the negative (-) sign and followed by <Currency>/<Unit of Measure> . The result should be just the double value (with the sign if its there), as in the above example, it should translate to -0.0004 I wanted to know if there is an easy way of doing it in C#, like using the Double.Parse() or the string.Format() methods (I tried them both but couldn't get them to work) Or do I have to parse the string character-by-character to get the required result Thanks in advance, MadMonk P.S.: Apologies if its a silly question, I'm still a newbie in .NET ...Show All
SQL Server Complaints about SSIS
I'm sure Microsoft has heard most of these complaints many, many times, but I just have to rant about the issues I've encountered with SSIS over the last few weeks. Basically, SSIS, IMO, is a pile of dog ***. Yes, it gets the job done, but only in an extremely inefficient fashion: Objects are ID'd by a GUID. This means that, (for instance) if you change a connection by deleting an existing connection and replace it by another, all of the objects using the old connection break -- EVEN IF YOU USE EXACTLY THE SAME CONNECTION NAME -- because they only know the connection by the GUID. Deleting the old Connection, even if you rebuild the new one with exactly the same name, pointing at exactly the same server, etc., breaks everything because a ...Show All
Visual Studio Express Editions Can anyone help me count letters?
In VB 2005 express: I am writing a 'word calculator' program that: -Uses the textfile in "textfilecontents" (textbox) -Scans each character, from each line of 'textfilecontents' Here is what I've got so far: -If the character is a letter, then: -convert the unicode value of each char to it's base value. (A=1 B=2 C=3 D=4, ect.) -adds the base value of each letter to 'TALLY' (integer) -display character read to "txttallied" (textbox) -If the character is NOT a letter, then: - display the character to "txttallied" (textbox) - don't add to tally (only letters are counted) -If the character is a carriage return: then: -display TA ...Show All
Visual Studio 2008 (Pre-release) Error coming when run XAML application
Hi, I am getting a problem when I run my xaml application.When I build my application it successfully builds,but When I tried to run it error comes like this. Cannot create instance of Classdefined in assembly , Version=1.0.2540.32480, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'test.xaml' Line 1 Position 7. I have taken to canvas and in both of them I have taken 2 textboxes as child elements of them.I Set bind width,bind height,bind top and bind left property of textboxes related to their canvas.If I comment all code of one of the canvas and its child, then application works fine,but when I run application with both canvas runnung, I am getting above error ...Show All
Visual Studio Tools for Office How to merge 2 Word docs, and also 2 Powerpoint presentations?
Hi, Not sure how to go about doing this one: I've got 2 word documents that I want to merge into 1 document programmatically, using .NET - any thoughts I also need to do the same for 2 Powerpoint presentations Thanks Hi Neal Best to ask this in the Powerpoint newsgroup. You'll find some object model help, here, but the forum is targeted mainly at the VSTO technology. And since Powerpoint is relatively new in the mix, very few people with extensive Powerpoint experience drop by. The specialists all congregate here: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.powerpoint&lang=en&cr=US ...Show All
Visual C++ How to overload the ">>" operator for a user-defined type
Hi, I have a Location class in my project, and I need to read a Location object by using cin >>, eg: Location locationObject; cin >> locationObject; I'm wondering if there is a way to overload the >> operator for a user-defined type like this. I trid to code the overloading method: istream& operator >> (istream& is, const Location& addLocationObject) { return is >> addLocationObject; } The compiler does not complain, but there is a error at runtime when the >> operator is called: "Unhandled exception at 0x00414219 in C++Project.exe: 0xC00000FD: Stack overflow." and it's pointing at the second line of the method above. Any suggestion Thanks in ...Show All
Software Development for Windows Vista Problem with the manifest file for Vista
Hi, I have to embed the manifest file for my application for Windows Vista. I have added all the necessary information in the manifest file and embedded it to my application using .rc file of my application. And it is working file. But I am facing the problem of the different manifest files for Debug and Release version. Please have a look at the following: In Debug version: < dependency > < dependentAssembly > < assemblyIdentity type = ' win32 ' name = ' Microsoft.VC80.DebugCRT ' version = ' 8.0.50608.0 ' processorArchitecture = ' x86 ' publicKeyToken = ' 1fc8b3b9a1e18e3b ' /> </ dependentAssembly > </ dependency > < dependency > < dependentAssembly &g ...Show All
.NET Development Writing/adding elements to a xml file
Hello! I want to add another book (book4) to the xml file below. What I did: XmlDocument document = new XmlDocument(); document.Load("info.xml"); XPathNavigator navigator = document.CreateNavigator(); But how do I navigate to the required node and add another book Hopefully someone can help. Thank you. info.xml: < xml version="1.0" > <Info> <Author> <FirstName>John</FirstName> <LastName>Boy</LastName> <EmailAddress></EmailAddress> <Gender>Man</Gender> <Birthday></Birthday> <Address /> <ZipCode /> <City /> <Country /> <Telephon /> </Author> <Books ...Show All
SQL Server Creating a DECLARE variable with SMO
How can I create this stored proc with the SMO StoredProcedure class It doesn't want to work and I think it has something to do with the DECLARE statement. Anyone know how I can get this to work Cheers Jon storedProc.TextBody = "DECLARE @GroupID int" + "SELECT @GroupID = GroupID FROM Groups WHERE (GroupName = \"Administrator\")" + "INSERT INTO gworkshop.Users" + "(GroupID, Username, Password, Active, Deleted)" + "VALUES (@GroupID,@Username,@Password,@Active,@Deleted)" ; It seems that the problem was with the DECLARE @GroupID You need to add any parameters to the stored procedure, you can't add them in the SQL store ...Show All
SQL Server CanShrink Question
Hello all, I have a report with a dataset similar to this: description0 35 description1 0 description2 0 description3 0 description4 0 description5 45 description6 0 description7 0 description8 50 description9 10 ..... I don't care to see the records with a zero numeric value so I've configured the two text boxes the list box to set their values to "nothing" if the numeric value is 0. I've also configured both text boxes canshrink property to true. When the report renders, I get this: desc. header numeric header ------------ -------------- description0 35 description5 45 description8 50 description9 10 .... I get one blank line where the grouping of 0 valued numeric records are. That tells me the cansh ...Show All
Windows Forms TextBox with AutoComplete
Hi, I am trying to populate AutoCompleteCustomSource (for my TextBox) only when the user hits the <Enter> key. I.e. when the user hits the <enter> key in the TextBox, i want to (a) send the text to the server, (b) do a server-side search for matches, (c) return the set of matches to the client, (d) populate the AutoCompleCustomSource programmatically, & (e) then display the matches in a drop-down. The difference here relative to how one normally sets this up, is that i want to issue a server-side request for the list of matches, & dynamically populate the AutoCompleteCustomSource. Now, i am able to do (a) thru (d), above; just not (e). Any idea how i'd do this Thanks, Mark ...Show All
.NET Development Socket or Remoting in this scenario?
I am investigating how to build a cache server which can be access by multiple web apps in a web farm. However, I am not sure should I use socket or remoting to handle the cached data transprotation in the network. The scenario is: The cache system maintain a list of cached objects. Clients (web applications) will send a key to the cache server and the cache server will send the cached data back if the data exists. The data sending back could be large and could be any type of custom class. The web applications will have lots of users in future so the performance of handling large amount of requests is critical here. I need some suggestions on which approach I should use. Also, some ariticles mentioned .NET will cache sockets which will be ...Show All
Visual Basic Detecting Mouse Events in VisualBasic Forms
Hi all, Just wondering if any of you guys could help me. I have setup a form with some buttons and an textbox, and i would like the textbox to display a message in it when the mouse hovers over a button. For example: BUTTON1 -> Mouse hovers -> Texbox displays message The problem that i am having is the syntax of the statement, and the declarations involved. In the object browser I found the MouseHover object, but when i came to write out the statement the variable came up as MousePosition.Equals. Question 1: Is MousePosition the same as MouseHover Question 2: What do i have put after MousePosition/Hover so that it picks up movement over the mouse. Also, does anybody have any sample code for this kind of project ...Show All
Smart Device Development Creating controls for Datagrid
how can i created controls for Compact Datagrid. I’m not sure what you mean by “controls for Compact Datagrid” but perhaps this would do. ...Show All
SQL Server MDX query based on a subquery
Hi, I hope that some can help me with a small problem I have got. I am new to data warehousing and MDX and am wondering if it is possible to construct a query based on a subquery (something like a T-SQL IN Clause). Want I want to do is take all the customers who has looked at one product category (ex Dairy products) and see what else they have looked at. I guess what I want to do is create some sort of a filter to be able to only take those users from the measure and slice them by the product dimension again. I am using ProClarity and will also need to be able to use it in there. I am thankful for any help or any pushes in the right direction :-). Kind Regards Stefan Ghose I have found t ...Show All
