yeos_lee's Q&A profile
Visual Studio Express Editions Linklabels to open files
Hi, I've got a uni project that needs doing, but I've ran into a bit of a hitch. Basically, I have a linklabel which is needed to start a program and open a file in said program. Opening a program is not a problem, but opening the file is being a pain because the filename will not recognize spaces, eg, it doesn't like the directory 'My Documents' because there is a space in the middle. Any ideas on how I can get around this Thanks, Bort How are your opening the program If the file is a registered type you can open the file with the registered program using Process.Start("TheFileName") ...Show All
.NET Development SQLDataReader.GetOrdinal() fails rarely with IndexOutOfRange
Hi everybody, We were developed some Web-Services that run against SQL Server 2000 with SQLDataReader that executing Stored Procedures in the DB. Most of time (95%) everything is running well, but sometimes (when exactly, we don't know) the same WebService that worked 200 times, fail. The code is simple: public string myFunction( int ANumber ) { string strRetVal = null ; SqlDataReader myReader = null ; SqlConnection MyConn = null ;   ...Show All
SQL Server Data retrieval is much slower in RS than in management studio
A call to a stored procedure completes in 13 seconds when ran from within SQL Server Management Studio. A report whose data source uses the same stored procedure can take as long as 10 minutes to run. The same parameter values are used in both the direct call and the report. The execution log says almost all of that time is spent on data retrieval. How could that be What might be the cause I'll give it a try. However, looking at the Parameters column from the ExecutionLog table confirms that the values are the same. The report has the same parameters as the stored proc and simply passes the its parameter values along to the stored proc. ...Show All
Visual Studio Accessing parent project from invoked child project
When a project calls msbuild on a child project - is there any way to access anything in the invoking/parent project Is there any way to determine the project filename, or anything about the parent project This could be either via the msbuild XML or from a custom task, ie via the object model. I've been looking at the object model and at the internal classes but haven't found anything appropriate. /marcus By the way, I've tried these two ways to set the path. I think the problem could be my conditions: <!-- <Choose> <When Condition=" '$(ConfigurationToBuild.FlavorToBuild)'=='Debug' "> <PropertyGroup> <OutputPath>$(ParentBinariesRoot)\Win32\Debug\</Output ...Show All
Game Technologies: DirectX, XNA, XACT, etc. How create device without window?
When I set this parameter as null, is throwing exception "Error in the application". Why In MSDN - renderWindowHandle System.IntPtr Handle to a Form, Panel, or any other Control derived class. This parameter indicates the surface to bind to the device. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter can be null. If null is specified, a non-null handle must be specified when calling Device.Present. This can be done either by setting the PresentParameters.DeviceWindow property, or by using the optional param_Control_overrideWindow parameter of the Device.Present method. The simple answer is that you cann ...Show All
SQL Server Synchronizing SQL logins in a DB Mirroring.
Hello, I've a DB that is mirrored. I've actually only one user. I've replicated the user with the sp_help_revlogin Store Procedure to create the logins with the same SID on both SQL servers. Now the application that is used with this DB will handle per user authentication. Of course the application will use SQL login for the users connections. Now, I can easily automate the sp_help_revlogin usage for the creation of new users, but I've another problem. The users can change their passwords through the application. I'm wondering which process using for this: Dropping the users on the Mirror server – running the sp_help_revlogin on the primary to re-extract the log ...Show All
Visual Studio Express Editions Filtering a datagridview with more than one criteria
I have a datagridview with 4 columns that I need to filter based on 4 textboxes on another form. The following is code that works using just one of the text boxes: CatalogBindingSource.Filter = String .Format( "Year='{0}'" , Tracking_List.Year.Text) My question is, what is the correct format to include the 3 other textboxes (called Make, CardNumber, and Condition) so the datagridview is filtered based on Textbox1 AND Textbox2 AND Textbox3 AND Textbox4 The names of the other columns in the datagridview are the same as the textbox names on the Tracking_List form. Thanks, John Just use the AND keyword like this: String .Format( "Year='{0}' AND Make='{1}' AND ..." , Track ...Show All
Visual C# Three Dimentional array
Hi, I have created one three dimentional array,it contains some value.I want to create folder in following order C:\\DOWN\\MR\\MRDate1. C:\\DOWN\\MR\\MRDate2. C:\\DOWN\\CT\\CTDate1. C:\\DOWN\\CT\\CTDate1. that is C-->DOWN-->>MR and CT C-->DOWN-->MR-->MRDate1 and MRDate2 C-->DOWN-->CT-->CTDate1 and CTDate2 This is my three dimentional array string[,,] FolderArray=new string[2,2,2]{{{"MR","CT"},{"",""}},{{"MRDate1","MRDate2"},{"CTDate1","CTDate2"}}}; Please anyone help me.... regardsm justin Please NOTE: Whenever your one question gets resolved, please mark it as answered and mark ALL post as answers which has your ans ...Show All
Visual C# Best way to achieve this?
I need to run a loop to check if a file exists then delete it. Once its deleted it can stop looking. However, at the time the loop starts it may not exist, but it will evntually be created. do { delete(); Console.WriteLine("Checking"); } while (check() == false); private static bool check() { if (File.Exists(Environment.GetEnvironmentVariable("SystemRoot") + @"\myfile.dat")) return true; return false; } public static void delete() { if (File.Exists(Environment.GetEnvironmentVariable("SystemRoot") + @"\myfile.dat")) { File.Delete(Environment.GetEnvironmentVariable("SystemRoot") + @"\myfile.dat"); Console.WriteLine("Deleted"); } } For the first question - yes, you could check if file exists whe ...Show All
Visual Studio Express Editions Embedded fonts doesn't work in printing controls ?
Hi, i'm writing a .Net application for printing barcodes to my climbing club. For simplicity reasons, i've embedded my barcode font as a ressource file. When loading my font as a private font i am able to use it in labels, textboxes, etc... but not in printing controls, like printpreviewdialog Could you please help me Here is my code for loading my font : Imports System Dim MyEmbdFonts() As String = {"code25I.ttf"} Dim FntFC As Drawing.Text.PrivateFontCollection = GetFont(MyEmbdFonts) Public CBFont As New Font(FntFC.Families(0), 42) Public CFont As New Font("Arial", 10) Private Declare Auto Function AddFontMemResourceEx Lib "Gdi32.dll" _ (ByVal pbFont As IntPtr, ByVal cbFont As Integer, _ ByVal pdv As Integ ...Show All
Windows Forms Listbox MouseDown and SelectedIndexChanged Event Handlers Conflicting
I have two databound listboxes which when I use drag-n-drop the MouseDown Event does not allow the SelectedIndexChanged Event or Click/DoubleClick events to be handled. Any suggestions. I had the same problems. To get around the selectedIndexchanged problem (and resultant errors that the count of selected indexes was set but the selected indexes and items were not set properly) I had to just keep my own arraylists of the indexes that I selected in the mousedown box. It was tricky because I now needed to manage the lists but I was able to make it happen. To get around the double click all that has to be done is to use the MouseEventArgs e.clicks to see if they are 2. If they are 2 then it ...Show All
Visual Studio Tools for Office Exception thrown getting just created ListObject control
I am getting an exception when trying to add data to a range within a list object. The strange thing is that I ran my installer on 7 different PCs, all with the same version and features of Office installed, and ran the same test scenario. The exception is only being thrown on one of the 7 machines. On the other 6 PCs, everything works wonderfully. The code is like this: myListObject = myWorksheet.Controls.AddListObject(myRange, myListName); myListObject.DataBodyRange.set_Value( Microsoft.Office.Interop .XlRangeValueDataType.xlRangeValueDefault, dataArray); The Exception is being thrown in the line of code when I try to set the data within the object (the second line of code above). Here is my exception: This document mig ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Spacewar failed to build... Different processor target
I'm getting this warning and the project won't build Warning 2 Referenced assembly '..\..\..\..\..\..\..\Program Files\Microsoft XNA\XNA Game Studio Express\v1.0\References\Windows\x86\Microsoft.Xna.Framework.dll' targets a different processor than the application. MySpacewar1 I'm using a Dell XPS M1710 with a Core Duo 2Ghz processor. Any help please. Sinnix wrote: Perhaps, but as I mentioned: I've got a single core, old school P4. ;) I was actually thinking this could be a bug. It seems to happen only when I do things in a certain order. I'm going to play around with it a little more before I file a br though. what did you do in what order ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Using an array in a vertex shader
My understanding is that a vertex shader works on a single vertex at a time. If that's the case, I'm confused about how to call a shader using values that are in an array. Say I have a mesh of ten vertices, and I have a an array of 40 vector3's. Each index in this array contains a unique vector value and corresponds to a vertex in the mesh, so, the array represents four frames of data that I want to use in a calculation within a vertex shader How is it done Like I said my understanding is that the shader operates on a single vertex at a time, so I can't pass the whole vector3 array to the shader. I have to get the right index, and pass that value to a vector3 global in the shader, which doesn't sound like a big deal, right The problem is ...Show All
Visual C++ .lib file is a static library file or DLL implicit linking file?
Hello everyone, If I am given a .lib file, how can I check whether the .lib file is a static library file (archive of obj files) or DLL implicit linking file I have such confusion since they both use the same extension name .lib. regards, George You can find out with Dumpbin /exports library .lib. If it is a DLL import library (like kernel32.lib), you'll get a list of names under "Exports". If it is a regular link library (like libcmt.lib), you'll see no "Exports", just a summary. ...Show All
