Jagdeep Sihota's Q&A profile
Visual C# Excel files are accessed by more than one application or not ?
I am using Excel Files to store my application data. Please tell me Can Excel allow more than one apps access it or not (like SQL Server,...). Thanks so much! No Excel open files with Write access means locks it while its opened. You can oly access this file with other software when its realeased by the earlier one. To check a file if its in use or not Try to open a file with Write Access in a Try catch block, If Exception is thrown then it means its used by some other software! Cheers ;-) ...Show All
Windows Forms Adding Menu Separator to a ComboBox
I would like to be able to add menu separator items to a ComboBox control. I'm guessing I'm going to have to create a derived class and override the OnPaint() method. Any suggestions on the best way to draw it Are there any existing examples of doing this - be great if I could avoid re-inventing the wheel! Many thanks in advance, John If you set the DrawMode of a ComboBox to OwnerDrawVariable, you can handle the MeasureItem and DrawItem events; you don't need to derive your own class. If you maintain a List of item indexes before which you want a separator, you can add some extra height to those items in the MeasureItem event, and draw the line in the DrawItem event, something like this: private ...Show All
Visual C# toolStrip with Database connection
i have a combobox on my toolStrip How can I populate with data from a database I am getting : Error 1 The name 'CommandBehaviour' does not exist in the current context void populate_category() { npg_connection = new NpgsqlConnection ( "Server=www.db.2connectbahrain.com;Port=5432;User Id=jassim_rahma;Password=xxxxxxxx;Database=xxxxxx;" ); npg_command.CommandText = "Select reports_category FROM reports_category" ; npg_command.Connection = npg_connection; npg_command.Connection.Open(); npg_reader = npg_command.ExecuteReader(CommandBehaviour.CloseConnection); while (npg_reader.Read()) { tool_category.Items.Add(npg_reader.GetValue(0)); } np ...Show All
Software Development for Windows Vista Red 'X' in exchange webmail
Since using Vista RC1, I cannot get Webmail to work on exchange server 2003. (sp2). I've tried anohter webmail client at my ISP and that's OK. What happens is, when you have logged in and you go to compose a new message, you get a red 'X' in the very bottom window where you would normally type the body of your email. I have turned off the phishing filter, pop up blocker.. and even added the site to the trusted zone, but to no avail. The really strange thing is that I don't think it's an IE7 fault, as I was using the Beta of IE7 on my PC before upgrading to Vista, and it worked OK. I have a jpg if there is a way of uploading it. i have submitted this to Microsoft, but wouldn't mind an answer prior to final release! Chee ...Show All
Visual Studio IVsTextMarkerClient multi-level context menu
Is it possible to create multi-level menu items from a IVsTextMarkerClient (perhaps inside the GetMarkerCommandInfo method) The sample code below adds one menu item for each item in the pointcuts array, but I would like to add only one menu item with each array element as sub menu items. public int GetMarkerCommandInfo(IVsTextMarker pMarker, int iItem, string[] pbstrText, uint[] pcmdf) { if (pbstrText == null) { return VSConstants.S_OK; } uint flags = (uint)(Microsoft.VisualStudio.OLE.Interop.OLECMDF.OLECMDF_SUPPORTED | Microsoft.VisualStudio.OLE.Interop.OLECMDF.OLECMDF_ENABLED); if (iItem < pointcuts.Length) { pbstrText[0] = pointcuts[iIte ...Show All
Smart Device Development How to host Media Player Activex Control in a console application or without window?
I want to use WMP activex control to play audio files varies many formats background.Now I can implement it in a windows application.When I try to do it in a console application,I failed. My target platform is WM5 ppc.Can anybody help me I'm not sure if it will be possible or not to do so since mediaplayer usually likes a window and I am not really familiar with the details of how controls work, however here is an article about how it might be done: http://www.codeproject.com/com/consoleactivex.asp ...Show All
Visual Studio 2008 (Pre-release) The certificate must have a private key. The process must have access rights for the private key.
Hello All, I used makecert to generate a certificate named 'ServiceModelSamples-HTTPS-Server and installed it in LocalMachine\My store on the server. I used the FindPrivateKey utility to find the keyset file and gave full control to NetworkService, InternetGuestAccount and ASPNET machine account. I installed the certificate on my client machine as well in CurrentUser\Root as well as LocalMachine\My. My service is hosted in IIS and I have enabled 'Anonymouse Access' to the virtual directory and checked 'Accept Client Certificates'. I can browse the svc file to view the wsdl from the client machine. However, I get the aforementioned error when I run my client app and make a call to the method using the service proxy. My client ...Show All
SQL Server SSIS + SSAS => Fairly consistent hanging?
I have an SSIS package that reprocesses part of my cube. I've tested that it works, and deployed it as a SQL Job to run regularly. Strangely, it seems that the SSAS server hangs fairly regularly and when the SSIS job starts to run, it'll be stuck for hours. Is this expected Should I be bumping our SSAS service nightly Are there tools available to monitor SSAS service health I've done this previously - while the command gets sent successfully to the SSAS server, there's no response nor activity that is exhibited by the service. I can keep profiler open and try to get the exact output for the next time this happens if it will help. ...Show All
Windows Search Technologies Problem configuring a custom protocol handler on Vista RC1
I have developed a hierarchical custom search protocol handler, which I have been trying to integrate with Windows Search on Vista. The steps I've taken to register the handler are: 1. Create a REG_SZ value under HKLM/Software/Microsoft/Windows Search/ProtocolHandlers. The MSN WDS Toolbar documentation mentions an AddProtocol method that can be called on the SearchManager, but this does not exist in the ISearchManager interface in Vista (see searchapi.h in the SDK), so given the lack of documentation for alternatives I've registered the key directly. 2. Use ISearchCrawlScopeManager to add a search root and default scope. The search root is created with IsHierchical = TRUE and FollowDirectories = TRUE. The registration itself compl ...Show All
Windows Forms How to create an instance of System.Windows.Forms.AxHost.State ?
I am writing an user control, it would add the ActiveX control by checking the installed version of Office Web Component SpreadSheet (currently there are OWC11, OWC10, OWC components). After checked the installed version of OWC, I create the instance of the axXXX library which generated by vs.net 2003 & add this instance to UserControl.Controls. If I do nothing more then it would be OK, but I wish to set the CSVData property of the instance after the constructor of the UserControl finished. I got an error said that OcxState of the OWC instance is valid. I noticed when I drag & drop the OWC control into the UserControl, the designer would generate the code such as : owc.OcxState = ((System.Windows.Forms.AxHost.State) ...Show All
Windows Forms Context Menus for webbrowser sub elements
Hi All I'm working on a custom control for my Web Editor. The control currently just contains a webbrowser control. What I want to do is have different context menus for various web elements. For example, a Form Button would have an individual context menu when right clicked, and some Text would have a separate context menu. I'm assuming somewhere I'm going to have to use System.Windows.Forms.WebBrowser or something similar, but how do I define the individual elements within a webpage Hope this makes sense! Doesn't that create security issues with the eventual User of the application I'm sure I read somewhere that using HTML/JS DOM requires the user to have certain privelages. I could be wrong though ...Show All
Visual Studio Express Editions process kill
Hi guys can you help me out here if I do a Process.Start( "c:\program files\super mp3\smrpro.exe" ) smrpro opens in the middle of my form........ how do I reposition it, or dock it....and how do I kill it Process.GetCurrentProcess.Kill()......just kills my project any help please cheyenne hiya fan you know....you are far too advanced for me renee your coding baffles me..... This was why I recommended a control instead of the DLL what do you mean..... help me out please...... I got process start.........so how do I process stop..... simplicity is the key.....lol your fan cheyenne ...Show All
Windows Forms Mouse inside or outside the client area
Hello everyone, How can I check if the mouse is inside or outside the client area.. To be more specific I have tried to make a calculation for inner controls but this do not work for the Form. I also tried to add a MouseLeave event which sets the mouseInside boolean to false and a MouseEnter event which sets the same boolean to true.. But interestingly when my mouse is over a control inside the Form the MouseLeave event is fired.. I am doing a drag-drop operation and I need to know when the user tries to drag something outside the main form. Is there a way to achieve this Thanks in advance and best regards ! About a year ago I blogged about this on my companies blog. Unfortunately the blog no longer exists but I search fo ...Show All
Visual Studio Team System Best Practices for Collaborating on Diagrams
Has anybody developed any good practices for sharing an SDM diagram with people who don't happen to have access Visual Studio for filling details For instance, I am working on the architecture for a solution, and I've built an SDM diagram that shows the high-level design of the entire solution. I'd like to have a network engineer fill in the specific details of machine names, etc., for the various environments to which the solution will be deployed (development, testing, production, etc.), but I cannot count on my engineers having Visual Studio. If I could export to Visio, that'd be cool; the engineers all have Visio. Even if I couldn't do a full round-trip back into Visual Studio, it would still save me a lot of work to let them edit a V ...Show All
SQL Server Package executes on test database but not in production database
hi! I am able to run the package successfuly in test database. but not in production database. It throughs up error saying Description: Unable to load the package as XML because of package does not have a valid XML format. A specific XML parser error will be posted. Description: Failed to open package file "D:\\TAHOE\\APPS\\SSISPackages\\Integration Services Packages\\ArchiveMain.dtsx" due to error 0x80070015 "The device is not ready.". This happens when loading a package and the file cannot be opened or loaded c orrectly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format. End Err ...Show All
