Darshan Mistry's Q&A profile
SQL Server Question on the server trace in query analyzer
Hi, When looking in the server trace in query analyzer – I can see how many ‘reads’ a stored procedure does. So I'm wondering if we can determine whether our query is good or bad by looking at the number of reads/writes that showing in the Trace. Thanks in advance The CPU, Reads, and Writes values should display a low value if your queries are performing well. If they show high values, look at the text on which these values correspond to as this displays either the step or the query. Results in the server trace are asimilar to those that you have when you run SQL Profiler ...Show All
SQL Server financial year
how can you store a financial year in sql 2005 I would absolutely suggest a calendar table like this for your translation needs. You calculate it once, store it away and then reference it. Here is an article (with code) I wrote on how to load a calendar table, including columns for fiscal_year and month: A way to load a calendar table http://drsql.spaces.live.com/blog/cns!80677FB08B3162E4!1349.entry It also has several references to other articles. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Quaternion Multiplication is Broken
I believe that quaternion multiplication is broken. While you write matrix multiplications (to happen in order) as A * B, you have to write quaternions the other way around, qB * qA. I was chasing a "bug" in my animation code for the longest time before I found this! Here is a code sample that clearly shows the bug: class Tester { public Tester() { Matrix m1 = Matrix.CreateFromAxisAngle(new Vector3(1, 0, 0), (float)(Math.PI / 3)); Matrix m2 = Matrix.CreateFromAxisAngle(new Vector3(0, 0, 1), (float)(Math.PI / 3)); Matrix m3 = m1 * m2; Quaternion q1 = Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), (float)(Math.PI / 3)); Quaternion q2 = Quaternion.CreateFr ...Show All
SQL Server How to insert a new record (and get it's identity), if a record is not found
What I'm trying to do is write a query (actually it will be a sub-query) that gets the ID of a record using a standard SELECT/WHERE, but if the record is not found then I want to insert a record and return the ID of the inserted record. So far I've got this (which doesn't work!) SELECT ISNULL (( Select ContactID AS ID FROM [TileManager] . [dbo] . [Contact] WHERE ( [Salutation] = 'Mrs' AND [Forename] = 'Freda' AND [Surname] = 'Bloggs' )), ( INSERT INTO [TileManager] . [dbo] . [Contact] ( [Salutation] , [Forename] , [Surname] ) VALUES ( 'Mrs' , 'Freda' , 'Bloggs' ); SELECT @@IDENTITY AS ID )) Any help would be greatly appreciated. INSERT Contact (Salutation ...Show All
Windows Forms Accessing a MDI function from a child form
Hello all, I need help in how to access a function in a MDI form from child forms. I call a function in the MDI everytime a child form is lauched to check if is already open. If its open it makes it active or opens it in case it not and assignes its parent property. It also resizes the new child forms based on the screen resolution and keeps count of the child forms open I would like to use the same function to open a new form from a child form to set the form properties correctly and keep track of all the open childs. The problem is that i cant access that function from the child forms. i tryied to make it static but I get several errors when i compile. Any ideas Thank you This should get you ...Show All
Visual Studio 2008 (Pre-release) Bug in ItemsControl?
Hi there, The ItemsControl seems to have problems with item selection whenever the items in it override Equals(object) such that the behavior is not reference equality. For example, if you a bunch of Int32s to a ListBox and some of the ints have the same value, selection is broken. Here is some XAML to demonstrate the problem: < Window x:Class = " ItemsControlBugRepro.Window1 " xmlns = http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x = http://schemas.microsoft.com/winfx/2006/xaml xmlns:col = " clr-namespace:System.Collections;assembly=mscorlib " xmlns:sys = " clr-namespace:System;assembly=mscorlib " Title = " ItemsControlBugRepro " > < Windo ...Show All
Architecture Designing multi-company databases
I'm designing a website that can be used by multiple companies. It seems that there are two options: 1) The set of tables used by a company is owned by that company. This implies a database per company. This allows each company to upgrade individually but could cause managment problems with having many databases. 2) Use only one database but place a company ID column on each table. This implies only one database for the entire website but restricts companies from being able to upgrade independantly. Are there any other options besides the two listed above If not then which option do you think would be the best Depending on the database. If you choose a mature database like SQL Server, i ...Show All
Internet Explorer Development How to change back from IE7 RC1 to IE6?
I installed IE7 RC1 and basically I couldn't access any webpage. I used the connection diagnostic tool and it says many of my connections failed. However, other browsers work fine for me like this one. With this IE error I couldn't even use many of the download managers like the one for installing IE6 (it says connection failed or so). I'm very troubled and hope to reverse back to IE6. But when I uninstall IE7 RC1 from control panel, even though it seems that it was uninstalled, my IE7 still remains there. I tried many ways, even like trying to install a standalone IE and downloaded Microsoft's IE6SP2 registry, but still has the same problem. Is there any way I could revert back to like when I freshly installed Windows Thanks a lot. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Crashing Saleen, early XNA demo?
I remember when I first heard of XNA at Microsoft's press conference at GDC 2004. They showed off a really stunning demo of a Saleen crashing into a concrete wall. Go to Gamespot and have a look for yourself, if you haven't already, http://www.gamespot.com/news/6092125.html q=XNA. Will that demo and source code ever be available Cheers Alfons XNA isn't just Game Studio Express. It encompasses a large number of Microsoft's games-related development tools. Since the demos were shown so long ago it's highly doubtful the they were done with GSE, or that the conference even had anything to do with GSE. ...Show All
SQL Server SQL Server 2000: Tracking down source of failed logins
I was checking the logs because of some failing backups and found literally hundreds of enties for failed logins for user sa. This is does not seem to be related to the failed backups, because even after fixing the problem (disk space), the entries continue to pile up. Needless to say, the information provided in the log is a bit sparse: date and time, source (Login), message (Login failed for user 'sa'.). If that is actually enough to go on, then there must be some way of cross-referencing this information with that found somewhere else. Is there a 'somewhere else' or are there other things I need to do in order to track this down I don't suspect any malicious intent, but I'm not ruling it out. My main concern at this point is twofold: t ...Show All
Visual FoxPro How to implement Mouse leave for a form.
I have a very small form that opens up to display some info. I'd like the form to close when the mouse leaves the form. I noticed there is no mouseleave or mouseenter for forms. Any other method to do this Thx In vfp 7 you have: MouseLeave Event - mouse moves out of an object. You may drop a rectangular shape at margin of the form. When mouse leaves the object (aprox.same area with the form) form will close. ...Show All
.NET Development CreateInstance throwing exception when creating "string" type.
I have the following code that throws an exception when run: Object o = Activator.CreateInstance(Type.GetType("System.String")); Here's the exception: Unhandled Exception: System.MissingMethodException: No parameterless constructor defined for this object. Sorry for bringing up this old thread, but actually I don't really understand why this exception is thrown, because String s = new String(); does work, so why do I receive this exception I'm asking, because I dynamicly create the object, so I just call: Activator.CreateInstance(aType). So do I really have to insert an if handling the String-Type because the Activator can't handle this ...Show All
Visual Studio Team System verify the type VSTF exists
I was trying to verify the type VSTF exists. but after GetRegistrationEntries, instead of <Type>vstfs</Type> I get <Type>String</Type> why is that thank you, please help me jiajia Actually the parameter is vstfs, my apoloigies, try the following and see if you get anything back. TeamFoundationServer myServer = TeamFoundationServerFactory .GetServer( "YourServerName" ) IRegistration myReg = ( IRegistration )myServer.GetService( typeof ( IRegistration )); RegistrationEntry [] myEntires = myReg.GetRegistrationEntries( "" ); for ( int p = 0; p < myEntires.Length; p++) { Console .WriteLine(myEntires[p].Type.ToString()); } ; ...Show All
SQL Server buffer is full
All, My weekly loading is failed and here is the error message I got. Could someone kindly point me what is the problem and how to detail with it Thanks Error: 0xC0047012 at Fact_ResidentService, DTS.Pipeline: A buffer failed while allocating 63936 bytes. Error: 0xC0047011 at Fact_ResidentService, DTS.Pipeline: The system reports 43 percent memory load. There are 4227104768 bytes of physical memory with 2378113024 bytes free. There are 8796092891136 bytes of virtual memory with 8787211939840 bytes free. The paging file has 10300792832 bytes with 14786560 bytes free. Error: 0xC0047022 at Fact_ResidentService, DTS.Pipeline: The ProcessInput method on component "Union All 1" (3629) failed with error co ...Show All
Visual Basic Starting another App
I want to add a command button and when this button is clicked I want to start another application, for example the calculator. What code do I use to accomplish this Sorry, but I am just starting out. TIA, JoeAbs I can't get this to work. For clarification where would I put it Private Sub Command1_Click() End Sub ...Show All
