Behrooz PB's Q&A profile
SQL Server SQL varchar conversion
Ok i've been asked to right a sp that converts a date. Now this is usually quite easy, but unfortunatly it was a poorly designed DB, and the date has been stored as a varchar(50) in the for dd/MM/yyyy, so doing a stright CONVERT(dateTime, Field, 101) doesn't work. So my question is, is there a way to do a varchar to varchar conver such as this: CONVERT(varchar(50), <field>, 'MM/dd/yyyy') where <fields> is varchar(50), and data stored within it is in the format dd/MM/yyyy. Thanks for any help you can give. Hello, There's a few ways to tackle this, with the easiest being: SET DATEFORMAT dmy GO SELECT CAST(ColumnNameHere AS DATETIME) GO You can use SET DATEF ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Problem with BoundingSphere
I am trying to use the BoundingSphere property of the ModelMesh class to perform collision detection. The problem I'm having is that the value of BoundingSphere.Center seems to have nothing to do with where I am drawing the mesh. (e.g. I last drew my mesh at (-110,-550,0) and the bounding sphere is centered at (-5.87,25.0,10.0) with a radius of 127.0. Below is my draw code for the model (following an approach taken from Microsoft's tutorials) and my collision detection check code. Any ideas about what I am missing Thanks! Draw Code: Matrix[] transforms = new Matrix[this.wallModel.Bones.Count]; this.wallModel.CopyAbsoluteBoneTransformsTo(transforms); foreach (ModelMesh mesh in this.wallModel.Meshes) { fo ...Show All
Game Technologies: DirectX, XNA, XACT, etc. A message for the XNA team...
Could I just take this opportunity to wish all of the XNA team a happy holiday / Merry Christmas (Shawn - hope you made it back into 'old blighty' through all the fog). Thank you for all of the hard work the your team has put in, so that we could have such a cool product to play with over the holidays. I can almost imagine what it would be like to be a 10 year old finding an XBox and creators club membership under the Christmas tree - I can still remember the thrill of finding a Sinclair ZX81 there and all the pleasure it brought... All too often as professional software engineers we loose sight of all of that, with the daft level of pressure, expectation (and overconsumption of caffeine!) that is prevalent now. F ...Show All
SQL Server Why I can't connect sql server 2000 with wm5 or emulator ?
Why I can't connect sql server 2000 with wm5 or emulator I used windows server 2003, sql server 2000 Enterprie SP4, visual studio 2005. My this code can connect to sql server with win application (.net framework 2.0) but can't connect to sql server with device application (.net compact framework). Dim strcon As New SqlConnection( "Data Source=192.168.0.3;Initial Catalog=nortwind;User ID=sa" ) Try strcon.Open() Dim sqlcom As New SqlCommand( "select * from products" , strcon) Dim s As String = sqlcom.ExecuteScalar.ToString Catch ex As Exception MessageBox.Show(ex.Message.ToString, "" ) Finally strcon.Close() End Try Question 1. How to tip for setup and confi ...Show All
SQL Server Warm Cache in SSAS 2005
Hi All, I have a MDX query performance issue. When the MDX was executed at the first time, its duration is about 600 secs. However, in the next executions, the duration is 1 sec. It seems the server cache needs to be warmed first. How can I improve the performance of the MDX query at the first time The reason is that the same MDX queries will not be repeated in my scenario. I tried to tune the aggregation for the destination cube via Usage based opertimization. Is there any good way to reduce the duration for the MDX query at the first time Thanks in advance! Thanks, Thomas. That can be a workaround. However, this method is limited in many scenarios. For example, the MDX query is resource consuming and the duration is very long ...Show All
Visual Studio Crash while Building DSL Project(s)
After two months of successfully building DSL's, I am now unable to Build any of my DSL projects. The build process terminates after the following line appears in the output: C:\Microsoft Visual Studio 8\Common7\IDE\devenv.com /rt "Software\Microsoft\VisualStudio\8.0Exp" /setup I'm able to sucessfully build these projects on another machine. I presume that my Experimental Hive has somehow become corrupted. Does anyone know how I can make my machine functional again You can try resettings your experimental hive. Available through a shortcut of the VS.NET SDK in your start menu. Or via: "VsRegEx.exe GetOrig 8.0 Exp". Hope it helps, Gerben. ...Show All
Internet Explorer Development Question for the pro - Get url of the active TAB in the current active IE window
This is a hard one! :( I have been cracking my head to figure this one out... I have managed to locate the current active IE window, but NOT the current active tab.. I always get the last opened tab:S I will wait with posting my code since it will probably ruin any good idea's... anyone know how to do this ...Show All
.NET Development force garbage collection
can we force garbage collection to be run In order for garbage collection to occur, no application threads can be running. Forcing a garbage collection means you're forcing your threads to suspend. If your threads don't really support being suspended for an indeterminate amount of time then you may run into problems by forcing a garbage collection. e.g. if your thread locks a region of a file temporarily while processing, that lock may remain much longer than you expect. Another problem is WaitForPendingFinalizers blocks your program for an indeterminate amount of time, so you don't want to call it on your main/UI thread. ...Show All
Visual C# to run this application, you must first install the following version of the .net framework...
I wrote an application using studio 2005 professional edition, and then I burn it to a CD, but when other people put the cd into their machine, I got this msg: "to run this application, you must first install the following versions of the .net framework v2.o.50727... how can I make the cd be used in any machine should I put some .net evironment software in the cd to go with my application this seems very un-convinient to use.... free download net framework: v2.o.50727 usa english mircrosoft Here it is net framework: v2.o.50727 Below I would like to mention.......................................................................................................................................! Gif a ...Show All
SQL Server Cannot shut down VS after using report designer
Routinely when I use BIDS to work on a report design, I cannot close BIDS because I get a message box that says: Microsoft Visual Studio cannot shut down because a modal dialog is active. Close the active dialog and try again. Of course, there is no visible dialog open. I actually have to terminate the process from task manager. I do not get this problem when using SSIS or SSAS. Only SSRS. Any Ideas Thanks! BobP I get this every time I design report (SQL Reporting services). I cannot shut down Visual Studio. It complains of a modal dialog being open but I can't find it. ...Show All
Smart Device Development Application loses focus when closing a Form - but only on one Form it happens...
Hi all, I have this strange problem/issue that I have had bothering me for a while now. I have an application where the users browses through Forms to perform various bits of functionality, and then closes the form to return back to the previous form (the Form from which it was openned), and the Focus is right back with the Form that openned the closed Form (if you know what I mean :)). Now this all works fine in my application apart from in one place, where when the called Form is closed, the calling form (or my Application even) doesn't get focus back until the 2nd tap on the application with the pen. The Windows start button and Input control on the MainMenu are focused and can be activated from the first click on them, but not my appli ...Show All
Visual Studio Tools for Office Managing documents from Custom Task Pane
I have been experimenting with VSTO 2005 SE and Office 2007 and would appreciate if someone could help me with the following: I would like to open different documents using a custom task pane and switch between these documents. I can create and open the first document. When it comes to the second document, it gets created on a different window (where my custom task pane is not visible). From the immediate window in the document VBA I can easily switch to another windows via Application.WIndows(index).Activate command. However I can't achieve the same result through the Add-In. Furthermore, the second document does not respond to the Ribbon button that toggles its display. How can I programmatically switch to the sec ...Show All
Visual Studio 2008 (Pre-release) May CTP: Where are array extension methods defined?
Nice work, the CTP - a tad flaky, but usable. I am in the process of upgrading one of my projects using LINQ to the May CTP. I managed to get the build process running, found the "missing" DLL's. I am now stuck with basically 5 compiler errors all related to extension methods. DLL's included are: System.Core; namespaces used are: System; System.Collections.Generic; System.Linq.Expressions; System.Linq; System.Text; System.Xml; The compiler chokes on: public IEnumerable < object > GetValues() { return _FieldValues.ToSequence(); } where _FieldValues is defined as: object [] _FieldValues; Can anyone enlight me In the May CTP ToSequence sas a valid extension that was de ...Show All
SQL Server What is the Flight Recorder?
Hi, Can anyone tell me more about the Flight Recorder I think I can probably make an educated guess but I'd like something concrete. What is it What does it do How is it different from the query log Is it something used to do an AS trace What are flight recorder snapshots The only thing I can find is here: http://msdn2.microsoft.com/en-us/library/ms174827.aspx -Jamie Thank you very much Edward. Can you give a "What if" scenario to describe where flight recorder info would be useful. Is the difference simply that Flight Recorder is always running -Jamie ...Show All
Visual Studio "The source code is different from the original version."
I just started having problems debugging my multi-project C# solution in VS 2005 (Windows Forms with a couple class libraries). When I put a breakpoint on a method header and hit debug, the breakpoint gets hollowed out and a yellow exclamation point is added. The tooltip explains: "The breakpoint will not currently be hit. The source code is different from the original version." While not debugging, I noticed that the tooltip for the breakpoint shows a 12 line difference: "At MyClass.cs line, 48 ('MyNamespace.MyClass', line 36)." Now, if I put a breakpoint thats not on a method header, it appears to work just fine. It breaks at the correct location and I'm able to step through the code line by line. I don't ...Show All
