Paul Monaghan's Q&A profile
Visual C# SELECT-INTO query problem
Hi I have a SELECT-INTO query which I wish to add some additional columns to the destination table. I can create the table and add the columns after it, but I wonder how is it possible to add that columns directly with the SELECT query. Thanks in advance, farshad Isn't this more a question for the SQL Server T-SQL forum http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=85&SiteID=1 ...Show All
Visual C# C# 2005 ignoring STAThread attribute
Greetings. I'm developing a WinForms-driven application, and I need it to use Single Threaded model for COM interop. C# 2003 worked fine with [STAThread] attribute above main() declaration. But we just upgraded our machines to VS 2005, and our application is failing due COM errors. We found C# 2005 is creating the main thread as Multithreading model, regardless the STA attribute. Any idea why is this happening . Here is a snippet of our entry point code, not complex at all. Putting a breakpoint in the first line of main(), already shows the System.Threading.Thread.CurrentThread.ApartmentState as System.Threading.ApartmentState.MTA. #region Main /// <summary> /// The main entry point for the applica ...Show All
Visual Studio Team System "Ghost" Pending Changes
I have a project that a few people have been making changes to and we seem to have "ghost" pending changes. What I mean is if I look in the Source Control Explorer, two of the project files (.rptproj and .rptproj.vspscc to be exact if this has anything to do with the problem) shows "edit, [more]" in the Pending Changes column and "user1, [more]" (where user1 is username of the developer) in the User column. When I click the project file and right click and select properties, under the status tab it shows the two users and the change type of edit. Now I know what the problem is, the developers got new machines, which means the names of the computers changed. Now because some changes where not ch ...Show All
.NET Development Multiple assemblies -- Single version
Hi, I have several assemblies that I need kept separate. I would however like to have all of them share the same version number. I already tried "sharing" a file with AssemblyInfo in it between them but that worked badly. Any ideas It's murky what exactly you mean. You don't have to put the [assembly: AssemblyVersion()] in AssemblyInfo.cs, you can put it anywhere. So, you could reference a common .cs file in all your projects that just defines the version number. More commonly (and advisably) is to let the major and minor version number designate the common version and let the build number and reversion number vary. That can be done automatically by AssemblyVersion("1.0.*") ...Show All
SQL Server ALTER COLUMN on an XML column type can give error Msg 511 after a few attempts
Basically I am trying to apply an XML Schema to an XML column after data has been added to the table. I need to do this to generate a computed column for use in an index to improve the access times. While I was playing with the schema getting the format/syntax correct I needed to apply and remove the schema several times and got errors. The following is how the errors can easily be generated rather than how I encountered them initially. Software=Windows 2003 Server, SQL Server 2005 The database table used, without the schema, was... CREATE TABLE [dbo].[EventXML]( [EventID] [INT] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [XMLData] [XML] NULL, [msrepl_tran_version] [UNIQUEIDENTIFIER] NOT NULL DEFAULT (newid()) ) The data com ...Show All
Visual C# Disable SQL Debugging in Visual Studio 2005
Hi, When stepping through code which indirectly talks to a database we are getting the following error "Execute Permission denied on object 'sp_sdidebug', database 'master', owner 'dbo' The IDE is Visual Studio 2005 and I have looked at the project settings and 'Enable SQL Server Debugging' is not checked. I would like to understand why I am getting the error inspite of this and what I need to do to disable this. FYI - Giving permission to execute the SP is not an option. Thanks Vidya Have you got any solution or ways around the problem yet I am in exactly the same situation right now. Thanks. ...Show All
SQL Server Suppress blank lines problem
I am having difficulty suppressing empty groups from rendering blank lines. For instance, take a simple left outer join to group detailed sales by region. The report has a regions group and the detail line. Every region that made no sales would print one blank line. If I add a subgroup between the region and the detail say to group by product within region then I get two blank lines for each no sale region. If I add another detail line then I get three blank lines etc. Has anyone else come across this and solved it Thanks. What i usually do is check the Len(FieldName) of one of the fields that would usually have data if the row is visible. If the Len(FieldName) = 0, that means visible is False. ...Show All
Software Development for Windows Vista would my application fail on xp and older os if I use the new vista platform sdk?
Hi, For example, I would like to something like if(osMajorVer = 6) { ChangeWindowMessageFilter(); } else { do nothing; } and compile/link it using vista platform sdk. would the app built in this way break in older version of OS Thank you very much in advance. The app will work fine provided that you don't statically link to any new Vista specific API's. If you want to use Vista API's selectively by checking the OS Major version then you must load the API interfaces at runtime through LoadLibrary and GetProcAddress. For COM objects there's no problem, the object will simply fail to create if it doesn't exist. -- http://www.chrisnet.net/code.htm http://www.avdevforum.com/AV/viewforum.php f=7 ...Show All
Visual Studio Express Editions Where to keep User ID and Password if the user choses to check remember my user name and password
Hi all, In a C# windows Application I have a login screen which will ask the user id and password. It also provides a check box "remember my user id and password". So when ever the user checks that check box, I have to store that information (user id and password) some where so that the user need not to enter again and again. So where should I store this information Which is the efficiant and secured way. Is this information should be stored in cookies or some where in windows registry or should I write a windows service for this or should I store in a file or database Please do me favour by your valuable answer. Thank you, Raviner Reddy.K ...Show All
Silverlight (formerly WPF/E) WPF/e vs. HTML
After reading Mike Harsh's blog post What WPF/e Really is . I'm kind of disappointed with the approach that the Architects are taking with WPF/e, as in that it augments HTML instead of replacing it. Why not Personaly I find that HTML slows me down in producing rich content for my users (something that WPF promises). Sure its easy, its fast, and we should keep it (not every website needs rotating letters). However, as I see .NET being used -alot- for mission critical application, I would only EXPECT WPF/e to take the fore front and upgrading the way we provide commericial services on the Internet in a fast, uniform way. Flash is doing this, Flex is not 'augmenting' the Web, its rewriting it. Share your thoughts. ...Show All
.NET Development Strange: Session cleared after Directory.Delete
Hi, usually session state is cleared after runtime errors (on a Win2003 Server with .NET2 using C#). But in my case a directory is deleted including all subdirectories and files using Directory.Delete(AbsolutePath, true), don't get any exceptions but nevertheless the session is cleared. By the way: Meanwhile aren't any session operations processed. Could anyone give me a hint, please Or did anyone experienced similar problems Thank you very much in advance! Marcus Hi, I've used the System.IO.Directory class and meant the session handling on IIS, cause the error occurs on a website. Kind regards, Marcus ...Show All
Visual C++ Scroll bar in slider
Hi All, i want to attach a scroll bar into a slider. is it possible... plz help me how to do this thing -Amjath take this article as reference it is handling with progress bar and slider. in the same way you can use scrollbar ...Show All
Visual Basic Programming Languages
Hi, I'm relatively new to programming, and Visual Basic doesn't seem to be that good of a language, and not that much used in real applications. I want to move onto a different language, one that is very popular, can do almost anything, and can be and IS used in professional applications. Another important factor is platform compatibility. Java provides that, but Java isn't that popular for Windows, and Windows is my primary target. C++ works, but I have a couple of questions: 1) Can C++ be used on any OS Is it a good language to use as my primary language 2) Is C# going to replace C++ Does that work on other OS's C# is newer, and so I'm thinking maybe its the new version of C++ that's going to replace it, as xhtml is probably going to do ...Show All
.NET Development How to display an image of the resources in an assembly in the WebBrowser control?
Hello, does anybody know how to display an image of the embedded resources in the WebBrowser control In VisualStudio 6 and the IE-control this worked like this: Code: "<IMG src=\"res://ErrorDialog.dll/Error.jpg\">" I tried it this way in .NET with the WebBrowser-control: I Code: "<IMG src=\"Properties.Resources.ImageError\">" but it doesn't work... Is there a way to do this Best Regards B. Ritter Hmm, I can only get it working for bitmaps, but not for icons. My resource file has a bitmap 101 and an icon 101. bitmap works: <IMG src=\"res://OptimizerErrorAnalysisDialog.dll/%232/%23101\"> ...Show All
Visual C++ Use of destructors, finalizers and delete??
I am programming a small class for settings in an application here is the code for the headerfile: ref class settingsHandler { private : String^ const settingsFileName; BinaryReader^ binReader; int appSetting; void readSetting( void ); public : settingsHandler( void ); ~settingsHandler( void ); property int setting1 { int get(){ return this ->appSetting;}} }; And this is the cppfile: #include "StdAfx.h" #include "settingsHandler.h" settingsHandler::settingsHandler( void ) : settingsFileName( "applicationSettings.dat" ){ this ->binReader = nullptr ; this ->appSetting = 0; } settingsHandler::~settingsHandler( void ){ if ( this ->binReader != ...Show All
