PeterJMoore's Q&A profile
SQL Server case expression plus outer join in ole db source
I'm trying to generate the data for a 2-column table, where both columns are defined as NOT NULL and the second column is a uniqueidentifier. In SQL Server Management Studio, this works fine: insert into table_3(column_a, column_b) select table_1.column_a, (case when table_2.column_b is NULL then newid() else table_2.column_b end) as column_b from table_1 left outer join table_2 on table_1.column_c = table_2.column_c That is, column_b of the SELECT result has no NULL values, and all 35,986 rows are successfully inserted into a previously empty table_3. (If I comment out the INSERT INTO clause and project table_2.column_b instead of "(case ... end) as column_b", the SELECT result includes 380 rows with a NULL in column_b ...Show All
Visual Studio A4 paper size with winforms reportviewer
Hi, Ive searced the web and found only a few dead ends, so i thought i'd ask in here, hope its the correct place! i have created a report that will use a localreport on a winforms app, the report works fine, however when i try to print it, it is always set to letter size paper, how do i change the print preview to be A4, and set the margins i have set the report size in the report, but it seems to make no difference. Regards, Russ You don't. You use it instead of putting ReportViewer on a form. You can either print directly or have it show a preview depending on which method you invoke. Create an instance of EmbeddedReport. Create report data sources as you would ...Show All
Windows Forms BackgroundWorker thread problem
Hello, I was using a backgroundworker to load some data into a datagrid, so it does a select query, and I set the datasource of a datagrid. But I got an error saying that the backgroundworker was working on the same thread as the application: Cross-thread operation not valid: Control 'dgvData' accessed from a thread other than the thread it was created on. How do I establish the backgroundworker on another thread Thanks. Anything in the RunWorkCompleted event (and also the Progress event) will already be executing on the correct thread. The whole purpose of the BackgroundWorker class is so that you dont have to worry about Control.Invoke(). ...Show All
Commerce Server Orders Adapter Failure
I am getting the following error on a receiving orders adapter. Im using the correct username and password for this service, can anyone tell me how to troubleshoot this issue further "Could not get the Whereabouts of the DTC on the Orders web service machine. Called byCommerce Server Orders Receive Adapter. Message An authentication failure occurred. Valid credentials could not be supplied for the Web service with URL 'http://localhost/OrdersWebService/OrdersWebService.asmx'.. Stack at Microsoft.CommerceServer.ServiceAgent.TryHandleWebMethodException(Exception ex, SoapHttpClientProtocol serviceProxy) " The first thing I would check is to make sure MSDTC is running and properly configured on &q ...Show All
Windows Forms datagridview currentrowindex and select & Unselect
hi in old days i used datagrid and currentrowindex to navigate recordes in datagrid , but now i want to convert from datagrid to datagridview but i found some properties are not the same her is my function i used: private int iRowIndex; private void fnSelectUnSelectCurrentRowIndex( int num1, int num2) { this .iRowIndex = this .dataGrid1 .CurrentRowIndex ; this .iRowIndex = this .iRowIndex + num1; this .dataGrid1. Select ( this .iRowIndex); this .iRowIndex = this .iRowIndex + num2; this .dataGrid1. UnSelect ( this .iRowIndex); } i still missing these static methods is there something equal your problem has been met by other guys,here is a thread which will help you h ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Display a Game in Full Screen Mode example causes screen to flash
Using Beta2. When I run the Display a Game in Full Screen Mode example my screen switches to full screen and then flashes white really fast. My video card supports the requested resolution setting. Anyone have any ideas. Running a GeForce 7950 GX with latest drivers. The code is simple this is all it does: graphics = new Microsoft.Xna.Framework.GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; graphics.PreferMultiSampling = false; // Switch to full screen graphics.ToggleFullScreen(); Thanks I guess the backbuffer was the issue. Added the clear call to the draw method and seems to work. graphics.GraphicsDevice.Clear(Color.Cornf ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Invisible Skybox
Hi i have used some of the code from the SkyBoxDemo tutorial to make a skybox in my game. I adapted the code to run with my game but when i debug the game i cannot see the skybox and my model following camera flips round to face the front of the model insted of the back and The Ship model turns weird colors! To answer your first question, just before I draw the starfield, I set these properties: graphics.GraphicsDevice.RenderState.DepthBufferEnable = false ; graphics.GraphicsDevice.RenderState.CullMode = CullMode .None; That will let me draw the starfield rather large (it is 40 meters in size). When I get ready to draw the model, I set DepthBufferEnable=true and CullMode=CullCounterClock ...Show All
Visual C# Does a C# Windows Service running on "local system" or "local service" have access to environment variable such as PATH?
I have created a windows service and deployed it using a setup project (.msi installer). I am wondering if the service has permission to access the windows environment variables such as PATH any help would be appreciated. Thanks, Keith Update: So I copied the folder that I was referencing in the PATH environment variable to the windows service project, recompiled and reinstalled it. Upon running the service with these files included the project worked fine, the .exe process started up fine. This leads me to believe again that the windows service does not have access to the PATH variable... Has anyone run into this problem or have any solution/ideas ...Show All
Visual Studio Express Editions Palindromes
I am trying to make a program that deals with palindromes (ex. 12321 or 11611). It is supposed to read a five digit intergers. After entering the number my program is supposed to tell me if it is a palindrome or is not one. If you can help it would be wonderful.Thanks KDancer was working with palindromes in a similar issue in this thead help with learning how to program ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Reading texture data
Hi! I'm using C# with MDX 1.1. I've got 1x1 pixel texture in G32R32F format (generated by my app). How can i read these 2 32bits FP values from this single pixel using CPU (not in the shader) [EDIT] Here's the code i've got so far: Surface luminanceSurface = device.CreateOffscreenPlainSurface(1, 1, Format .G32R32F, Pool .SystemMemory); SurfaceLoader .FromSurface(luminanceSurface, luminanceTextures[0].GetSurfaceLevel(0), Filter .None, 0); GraphicsStream gs = luminanceSurface.LockRectangle( LockFlags .ReadOnly); float [] luminanceValues = new float [2]; Marshal .Copy(gs.InternalData, luminanceValues, 0, 2); luminanceSurface.UnlockRectangle(); The problem is that the values i get are i.e. -3.126... and ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Strangest 'Bug' I've Found Yet
Hi, I'm still trying to draw large gridmap terrains on the 360 and so far am having a lot of success. Performance seems to be a lot higher than my 6800GT, perhaps by about a factor of about 4. The issue I'm having though is really rather strange and I've been wondering for the last couple of hours quite how it could be happening. I create a huge vertex buffer (as big as XNA allows before throwing an UnauthorizedAccessException at me) for the gridmap and draw the entire world (4million polygons) in a single draw call. Except the frame rate is good under some circumstances and bad under others, and the factors that make the frame rate plummet really shouldn't affect the frame rate at all. If I create only this one VertexBuffer and try ...Show All
Community Chat Virtual Intelligence, AI
People we need to talk about this. When people talk about this, they say its based on storing and retriving information. The learning process for the computer would be to save as much information as possible from its interactions with the environment. But when I think about this, I feel its a restriction to learning. Consider this, when we are small adding two numbers 2 and 3, would be done on fingers or on a peace of paper. But when we grow up we dont use the fingers or paper. So my point is: The input(add 2 and 3) remains the same, also the output(5) remains the same. So where did the process of learning go. Thus, I would suggest that a machine should not only learn and save in information, it should also learn to proce ...Show All
Visual Studio Express Editions Thread problems!
Hi everybody! I have a problem and I have no idea how to resolve it! I'm developing an application t'hat initialize all the com ports avalaible in the computer. Then I have a form that allow me to make a call. What i does is find avalaible com and send something. Then, some miliseconds after that, the com would have a ReceiveData Event. Inside this event process it would call the form from before and change form.text Is then when I get a cross-thread error, or something like this. Using System.Threading I found that I'm always in the same thread excepts when the com gets his receivedata event, that he get another Id thread => the funcions he calls are also inside another thread... Any Idea why this happend any way to t ...Show All
.NET Development Command in C# fr EchoOff & EchoOn...
Hi... What is the command for 'EchoOff' & 'EchoOn' in C# for SerialPort communication. I am developing one application which will communicate with one instrument & send/receive some ASCII text. Regards, Vinay There is no dedicated command for setting half-duplex or full-duplex communication. It is a feature of the application program and the device, not of the serial port communication protocol. Check for example the HyperTerminal applet, File + Properties, Settings tab, ASCII setup, "Echo typed characters locally". You would turn that option on if the device is operating in half-duplex mode and doesn't echo the received characters. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. .X -> ModelMesh - textures?
I imported a few .X models in my XNA project to figure out the basics of the ModelMesh. Applying custom effects and so on works already, BUT if a mesh has multiple parts and each has a different material, I cannot figure out where in the Model or ModelMesh is that information (I cannot guess the material and do not want to hardcode it or the name of the textures). Can anybody tell me where to get that information from when I load a model via the ContentManager At runtime, all you have is the actual texture data. If you do your swapping during the build in a custom processor (by deriving a new processor ModelProcessor and overriding the ConvertMaterial method) you will have a lot more information and ...Show All
