Lofote's Q&A profile
SQL Server Constants to Sets
Hi, I guess that's an easy one... I'm quite sure that my brain is gone for weekend... And I'm still getting used to MDX... I'm using the min function to find out the minimum of two measures, so basically: min({[Measures].[MeasureA],[Measures].[MeasureB]}) This works perfectly. But what I need is to have something like that: min({[Measures].[MeasureA],[Measures].[MeasureB],0}) So that when A and B are both greater than 0 the result is 0. OK, I can do that with iif but that's not nice... There must be a way to add a constant to a set... I even need something like that: min ({sum(...),sum(...),0}) I guess it's the s ...Show All
Visual C++ Debugger's Bug?
I encountered a weird thing about debugging in Visual Studio 2005 Professional. You could try it in your VS. May be it is a bug. 1. Make sure the "Debug" toolbar is dragged out. All the operation is on it. 2. Set a breakpoint. 3. Start Debugging from the Debug toolbar, wait until reach the breakpoint. 4. Stop Debugging and immediately Start Debugging. After you stopped debugging, it will take about 1 second that the "Stop Debugging" becomes unavailable. Just IMMEDIATELY Start Debugging when it is still available. 5. Now you would notice: 1) Program stopped at breakpoint; 2) Continue Debugging is unavailable (which should be available) ...Show All
Software Development for Windows Vista workflow and web apps
How do you go about utilizing WWF in a web application I'm currently looking into building a workflow system for publishing web pages in a cms. I've got a basic workflow built and have been testing it using a console application. I need to port this workflow to the web application where users would interact with it using webforms instead of a console app. I'm a little confused on how this would be done in a stateless environment. The workflow is the usual review process... a reviewer receives a notification via email that a page needs to be approved. They log into the web app and do their review and either approve or reject the page. If a ...Show All
SQL Server Running Total cursor
I have two tables. ID table that has these fields Code_id,YearPeriod, ReachedDate fields. And table Amount that has Code_id,Amount,Date fields. What I need to do is write a cursor that when the amount.Amount adds up to $100.00 it Updates the ReachedDate in the ID table to the amount.date fields value of that record. Any help would be greatly appreciated. You shouldn't need a cursor. Try this instead, first create a view to give the totals up to the current date. CREATE VIEW AmountTotals AS SELECT a.Code_id, a.Amount, a.Date, (SELECT SUM(b.Amount) FROM Amount b WHERE a.Code_id=b.Code_id AND b.Date <= a.Date) ...Show All
Windows Forms Generate SQL Script
This is more of a SQL question, but how do you generate the CREATE script that was used to create a table that already exists I thought it was DESCRIBE but I might be getting my DB's mixed up. Thanks! The simplest solution In Visual Studio .NET, display the Server Explorer. Navigate to your table, right click, and select Generate&n ...Show All
Windows Search Technologies Culture aware dates
Hi, Being from one of the original US colonies (the UK), we get our dates the wrong way around, i.e. dd/mm/yyyy. When I use the the 'date:' column in the API it's always en-US culture. Is that right, as the locale-dates then need converting for comparisons/math I was happily assuming that the new 2.6+ API would make this better, in that the API would be 'culturally aware', but you know what they say about people who assume, so thought I should check/suggest the idea. Also, as I am developing a product that embeds/utilizies the WDS, is there a way to sign up for beta's of the SDK etc, i.e. as I would be able to offer feedback ...Show All
SQL Server recursive queries
Dear all any body know how i can transform a recursive query to iterative one if possible i need a simple example witth little explanation Thanks alot. Try the topic "Using Common Table Expressions" in BOL. HTH ...Show All
.NET Development Suspending the main thread from an event handler, given Thread.Suspend() is deprecated
Since Thread.Suspend() is deprecated (and that seemed like my best bet), I'm trying to find a way to solve a problem I've been having. Essentially, I've got code running in a main thread, and event handlers handling events occasionally. What I want to do is pause my main thread whenever an event handler fires so that only my event handler executes, and the main thread waits until the handler is done to continue processing. Does anyone know a good way to do this Thanks! It already works that way... Event handlers that are activated by the main thread execute on the main thread. Event handlers invok ...Show All
Windows Forms registry in vb2005
How could i get a registrykey's value E.g: " HKEY_CLASSES_ROOT\.gif\" and i need the (default) item's value... how can i do this Using the 'My' namespace you can access registry values. eg. My .Computer.Registry.ClassesRoot.OpenSubKey( "NameOfSubKey" ).GetValue( "NameOfValue" ) ...Show All
Visual Basic Displaying data from SQL Server stored procedure
I have a practice app (windows form) in VB 2005 to help me learn the language. I have a data source connection to a SQL Server database that includes a stored proc ( usp_CrimRecTest ). It requires one parameter. I am attempting to retrieve first and last name based on info entered by the user and concatenated into an ID#. I created the data connection using a wizard and added it to the form by drag and drop. I set the databinding text and tag properties for the name fields to the corresponding name fields in the dataset. I have a button to get the name with this code behind it: Private Sub btnGetName_Click( ByVal sen ...Show All
Visual Studio Team System Text Files needed by Unit Test
I have a couple text files that my unit tests read from. I added them to my unit test project, and set Copy To Output Directory to Copy Always. But when I try to run the unit test it cannot find the file in the local directory. It is looking in this directory: c:\Visual Studio Projects\Planners\TestResults\smithd_SMITHD 2005-11-18 15_13_34\Out\ that directory only contains the .dll, .config, and .pdb. Shouldn't it also copy my text files into that directory automatically What's the proper way to do this Hello, Tests are executed from deployment directory - this is Out the directory u ...Show All
Visual Basic make my language as a default language
I have build my project, this prject has 2 languages, additional to the default One (desinging), now, I need to make One of my language as default instead of the default language is there any idea ...Show All
Visual Studio Team System Unable to rename a file back
I changed the name of a class under TF and checked in the change. I now want to change the class name back, but team foundation tells me a file already exists with that name. I'm unable to find a way to locate the original file under source control and permenantly delete it so I can change the class back. I assume this is a bug. Anybody else come across it, or have a work around Which version of Team Foundation are you using Did you rename from within Visual Studio or from the command line A few things to try: - run "tf dir" (or "h dir" for older versions) to see what files the server is currently ...Show All
Windows Forms App.config problem on windows 2003 server and xp
Hi all Im wondering if anyone has come across this problem we have a client that is useing a piece of software on a windows 2003 server. the software is installed on this server and a shortcut is then placed to the software on the users desktop boxes which can be windows 2000 or xp. When the user clicks that shortcut the programme runs from&n ...Show All
Windows Forms Application.Exit Problem
Hi I am facing a weird problem with Application.Exit in Windows 2003. After this statement is executed, the application does not go down and CPU usage goes up to 100. This problem occurs only in Windows 2003. Windows XP (SP2 and SP1) are just fine. Does this have any thing to do with COM Interop or license of components I have a VB6 OCX&nbs ...Show All
