Roy mm's Q&A profile
SQL Server Adding new columns with check constraints using same batch
I'm using a stored procedure to add fields to an existing table. These fields must have check constraints and I need to use one T-SQL batch. In Sql2000 Ok. In Sql2005, if table exists, I get error "invalid column xxxxx" in Add Constraint statement before new column creation. the code is Declare @Setup bit Set @Setup = 1 if @Setup = 1 Begin --Alter Table MyTable Add MyField Numeric(1, 0) Not Null Default 3 Exec mySp_Add_Column 'MyTable', 'MyField', 'Numeric (1, 0) Not Null', '3' If IsNull(ObjectProperty(Object_Id('xCK_MyTable_MyField'), 'IsConstraint'), 0) = 0 Alter Table MyTable Add Constraint xCK_MyTable_MyField Check (MyField >= 1 And MyField <= 3) End Else Begin -- drop column ...Show All
Visual Studio Tools for Office vsto2005se: error with creating project
I have a (admittedly not so bad) problem to report. If i have an existing solution named 'A' (just an example) already loaded in visual studio that contains a subproject named 'A' and i want to add a vsto2005se project named 'A.Something' (note the dot in the name) the vsto2005se project is created with the correct name but its setup project will be named 'A' which of course conflicts with the existing subproject 'A'. Instead, the setup project should be called 'A.Something.Setup' or something along these lines. Just wanted to report that with this naming convention creating a vsto project isn't a smooth experience. Cheers, simon Maybe creating a Solutions Folder is a workaround... In the main solution, ...Show All
Software Development for Windows Vista Create a non-elevated process
Hi, I need to create a process in my program (C#.NET) without elevated. My program is run elevated privilege (run as administrator). I simply use Process.Start(...) to create a process, but the process inherits the privilege. What method/class can do this As ridiculous as it sounds, there is no easy way to do it. See the following threads: starting application from setup - not as administrator ( http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=800574&SiteID=1 ) How to CreateProcess NOT as administrator ( http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=422705&SiteID=1 ) ...Show All
Visual C++ auto_ptr no longer type safe
auto_ptr is no longer type safe in vc8 / visual studio 2005 ! I just stumbled across this fault: it seems that you can assign a pointer to any type to an auto_ptr object. The code below compiles without failure or warning, and illustrates the problem. On vc6, the appropriate compiler errors are thrown. #include <memory> class Base { public: Base() {} }; class Sub1 : public Base { public: Sub1() {} }; class Sub2 : public Base { public: Sub2() {} }; class Class3 { public: Class3() {} }; void main() { Sub2 s2; /* all of these should fail to compile */ std::auto_ptr<Sub1> x; x = new Sub2(); std::auto_ptr<Sub1> y( &s2 ); std::auto_ptr<Sub1> z = &s2; /* The subclassing is not origin of the f ...Show All
Microsoft ISV Community Center Forums Text file search, return data from line other than search string line
Hi all, I am trying to pull information from a text (.txt) file and input it into an excel spreadsheet. With the "instr" and "mid" statements, I can pull any information from the line that the searched text is on, however, I want to pull information from the two or three text lines after the searched line. The reason I want the lines after the search string line is because the search string line is always the same, but the information on the lines afterwards are never the same. Here's an example of one series of lines in the text file: Case 1005 1 35 66 90 4 22 5 99 What I want to do is search the file for "Case" and then extract the two lines of data beneath it and place them on individual cells in ...Show All
Smart Device Development Pocket PC: VS2005 designer does not allow set proper size to TextBox control
Hi, VS2005, CF2.0, Pocket PC project(2003 or 5.0). According to Pocket PC UI Guidelines TextBox should have: - 9pt Tahoma font - 20px height If TextBox has 9pt Tahoma font, VS designer always sets its size to 21. How can I set TextBox size to 20 Is it a bug Thanks, Tom. Hi Tom, The designer of TextBox normalizes the height of textbox depending on the current font. With normal font size on windows, 9pt Tahoma has a size of 15px. While normalizing the height designer adds fixed margin of 3px (both above and below the text in textbox) to make the textbox height 15 + 2*3 = 21Px. If you set your windows font size to large (120 DPI) then textbox height will increase to 25 in designer. As y ...Show All
Visual Studio 2008 (Pre-release) Indigo Beta 2 uninstall faild, couldn't install July CTP
I tried to update to the .NET 3.0 July CTP, but the setup faild because of Indigo setup's failure. Then I tried uninstall Indigo manually, and every times I run the setup, it fails by deleting the Microsoft Digital Identity Service. I have Win XP SP2 Pro (Hungarian) with all updates, and VS2005 Pro without SQL 2005 Can you please delete all the files matching these criteria in %temp% folder %temp%\dd_*.txt %temp%\dd_wcf* After deleting above files, please run uninstall program and send me %temp%\dd_*.txt and %temp%\dd _ wcf* files please send me c:\Windows\Microsoft.NET\Framework\v2.0.50727\config\web.config also my email id is madhup@microsoft.com -Thank ...Show All
Software Development for Windows Vista Exception on raising an event
Hello, I'm developing an example project very similar to expense reporting (lab01), with two event handlers. I can fire the first one (submitted event) without any problems, but when I try to raise the second event (reviewed event) I get an exception that sais: "EventDeliveryFailedException was unhandled" and the message is "Event "RevisatCOF" on interface type "WorkflowValidacio.Interficie" for instance id "ef46e5fa-64c7-4343-9d3c-c62b829f9c37" cannot be delivered." I followed exactly the example in expense reporting, so I have the event declared in my interface and in the implementation class, and I raise the event like this: RevisatCOFEventArgs e = new RevisatCOFEven ...Show All
Windows Forms force to open all forms inside MDI
Hi, I am consolidating a number of stand-alone windows application under one MDI application. The development of those stand-alone applications is separated in each different project. Is there a way to force any forms that open inside those applications to be open inside the main MDI form (if the application is callled from the MDI) Thanks, Igor Hi Igor If I understand your question properly, you want to save the time and trouble of finding the Show or ShowDialog methods in the other applications -- there's no way to change the behaviour of these calls without changing them to set the child form's MdiParent property and/or pass the owner form instance handle. Something else to watch out ...Show All
Visual Studio "pdm.dll was unable to register itself in the system registry"
I get this error right at the end of the Visual Studio 6.0 Professional installation process: "pdm.dll was unable to register itself in the system registry" and then a message stating the installation setup did not complete. I'm using Windows XP SP2. I've noticed I can run Visual Studio 6.0., but I can't get it to install or uninstall. I cannot upgrade to the VS 6.0 SP5 either because it does not find Visual Studio 6.0 on my machine. What can I do to remedy this VS6 questions should be posted here: http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx dg=microsoft.public.vstudio.setup&cat=en_us_d3a810e2-c052-408d-a151-0097150ba2cb&lang=en&cr=us ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Resonable Expectations for XNA Game Studio Express?
Based on my understanding of what I have read so far I have the following assumptions (please correct me where I am wrong) and questions: With the XNA Game Studio Express I will be able to develop PC games and with a developer membership I will be able to compile a version that I can transmit localy to my XBox 360. In the first incarnation that will be released there will be no support for networking (ie. Live) online multiplayer. Is there a legal method to distribute content created from XNA Game Studio Express to specificaly targeting the XBox 360 envirionment (ie. Can you legally provide compiled or uncompiled games with the intent for other developers to download and run your creations ) Will there be any means available for XNA Game ...Show All
Visual Studio Team System How to get List of Reports for a particular project from Team Foundation Server programmatically?
Hi All, I want to show the list of Reports for a particular project from Tfs into my web form. How do i get the list of reports programmatically Is there any API or web service which i can use Please help me in the regard asap.Its urgent. Thanks in advance, I also want to know how to get a list of Reports. I do not want all Items on the server. I am only interested in reports (report paths to be specific). I do not see in the links above any kind of filter criteria you can pass into the ListChildren method to only bring back reports. This is a hack, but will work. Basically you bring back everything, then filter out all but reports. Highlighted is the code to filter out everything bu ...Show All
SQL Server Updating a table by both inserting and updating in the Data Flow
I am very new to SQL Server 2005. I have created a package to load data from a flat delimited file to a database table. The initial load has worked. However, in the future, I will have flat files used to update the table. Some of the records will need to be inserted and some will need to update existing rows. I am trying to do this from SSIS. However, I am very lost as to how to do this. Any suggestions Jamie Thomson wrote: msFlash wrote: Thanks for the response; however, I can't seem to get to the link you sent. Well it works fine for me so I can't help you there I'm afraid. -Jamie Jamie, I was able to get to your blog from hom ...Show All
SQL Server get the list of catalog views in SQL Server 2005
How to get the list of catalog views sys.* (sys.objects, sys.columns ....) in sql server 2005 select * from sys.objects where objectproperty(object_id, 'IsSystemTable') = 1 did not return the list as I've expected thanks Or :-) SELECT From Information_SCHEMA.Views Where Table_schema = 'sys' and Table_Type = 'View' HTH, Jens K. Suessmeyer --- http://www.sqlserver2005.de --- ...Show All
.NET Development Refrencing the COM not working
Below I have included the relevent source code; when ever I try to refrence the .tlb in VB.net 2003 HE or VC# Express 2005 it gives me the following error: A refrence could not be added. Converting the type library to a .net assembly failed. type library EButton was exported from a CLR and can not be re-imported as a CLR assembly using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace EButtons { [ InterfaceType ( ComInterfaceType .InterfaceIsIDispatch)] [ Guid ( "DBE0E8C4-1C61-41f3-B6A4-4E2F353D3D08" )] public interface _EButton { } [ Guid ( "C6659361-1625-4746-931C ...Show All
