Tom King's Q&A profile
SQL Server is it possible to have variant condition clause in procedure?
i want to use OLEDB to build a COM for my app in the case, i want to execute a select statement which the where-clause is variant. ex, select * from db1 where code='abc' select * from db1 where name='mike' As it's very difficult to change sql-command in oledb, i want to build a procedure like this, create procedure viewDB @filter CHAR(20) as select * from db1 where @filter go but failed! i tried EXEC( select ), but i cant get the variants when building a oledb consumer Yes, it is safe if you do not do anything else inside if this SP. Just small suggestion. If you can, select just the fields you need a ...Show All
Visual Studio How to get a path to a freshly built assembly?
I'm trying to guess it based on active configuration, but that won't work in all cases. Are there any better ways for doing it I've looped over all project properties but found nothing there :( // build it... string config = vs.Solution.SolutionBuild.ActiveConfiguration.Name; vs.Solution.SolutionBuild.BuildProject(config, prj.UniqueName, true ); string path = prj.Properties.Item( "FullPath" ).Value.ToString() + "bin\\" + config + "\\" + prj.Properties.Item( "OutputFileName" ).Value.ToString(); The best way to find built files is through output group ...Show All
Windows Forms Resolving a relative/absolute path?
Which is the best way to resolve a path if you don't know whether it's absolute or relative This is what I have so far (C#): string resolvedPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), <b>pathToResolve</b>)); Is it the best way Is it fail safe If not, which steps do I then have to take to make it safe I would like& ...Show All
Visual Basic Cannot concanate output from two richtext boxes
Hi pals, I know this may sound stupid but i'm unable to concantenate richtext output from two rich text boxes. For example: Consider two Richtext boxes: R1 and R2 when I type in code: R1.rtf & = R2.rtf R1 appears blank after running the code. I need help please! The richtextbox does not like concantenation characters (+ or &) you can however use the selectionstart method to set the insertion point or just use the append text method: Me . R1 . AppendText ( Me .R 2 . Text ) ...Show All
Visual Studio 2008 (Pre-release) Avalon Beta and VS2005 - Black screen in browser window
Hi All, I'm having a problem with the Nov CTP on VS2005 whereby when I run a very basic application all I get is a black screen in a browser window. It seems to work on a fresh reboot (sometimes) and will not work again. I'm noticing others having the same problem... http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.windows.developer.winfx.avalon&lang=en&cr=US Any clues Known bug, reproducible on some CPUs. I answered this elsewhere on the forum. See http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=174784&SiteID=1 ...Show All
Visual Studio Team System [WebTests] App.config in Testproject can not be referenced
Hi all, I also have a problem using an App.config file in connection with Web Tests. I have looked at all threads concerned with this topic in this newsgroup before but non of the resolutions worked for me unfortunatly. Here is my problem: I would like to reference an App.config file from my web tests for several reasons: - I am using the enterprise library building blocks and I need to set some configurations in the App.config file. - I would like to read out a Connectionstring from the App.config file. The problem I am running into seems to be quite simple: it does not pick up the App.config file in my test project when ...Show All
Windows Forms Copy one DataTable to another DataTable?
Hi, How can I copy selected columns from one DataTable to another This should be easy, but I can't seem to figure it out. Beener Hi, Why dont you just copy the datatable and remove the rows you need -Edward ...Show All
Visual Basic How to Count Files and Folders in a directory
Please post your code to count files in a folder and how to get the folder count in a directory. Thanks. Dim s As String = "C:\FolderName" Dim d As New System.IO.DirectoryInfo(s) Dim intFolders, intFiles As Integer intFolders = d.GetDirectories.GetUpperBound(0) + 1 intFiles = d.GetFiles.GetUpperBound(0) + 1 Msg ...Show All
SQL Server Sept CTP failed to install
I am getting the following error when I try to install the September CTP on a Windows XP Pro box. The error is SQL Server Setup Failed to compile the Managed Object Format (MOF) file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\etwcls.mof. To proceed, see "Troubleshooting an Installation of SQL Server 2005" or "How to: View SQL Server 2005 Setup Log Files" in SQL Server 2005 Setup Help documentation. Anybody have any ideas This is an issue that got fixed in RTM code. Please re-post if you're still encountering it. Paul ...Show All
Windows Forms tab control + validation
Hi there, I am using a TabControl with 5 tabs. Is it possible to disable some of the tabs and make them available i.e. if the application is connected to the server Also I was wondering if there is something similar like the validation controls on webforms for the winforms as well. I am using VS .Net 2003 and C# Thanks a lot for your help.&nb ...Show All
Windows Forms Transparent Panel Headaches
Hi, I'm having a really frustrating problem when using transparency in a Panel, if anyone has any suggestions I would really apreciate it. My problem is the following: I have a Form with a Panel contained on said Form. The Panel has the BackColor property set to "Transparent". I would like the background of the Form to be visible through the panel (I assume this is what setting the BackColor property to transparent means ). When my form first loads all is well - the underlying Form is visible through the transparent Panel. However, if I minimize the Form and then Restore it - now my transparent Panel displays what is underneath the ...Show All
SQL Server how to order stored procedures or tables by date
We used to do this extensively in the old enterprise manager.. this is needed on big systems with lots of tables and stored procedures becuase you normally don't remember the name but it is the most recent thing you were working on.. anyone know how to do this in the new sql server management studio.. thanks There is create date in sysobjects but there is no last updated date. So if you use alter procedure there is no trace. But if you use drop procedure + create procedure, then you can use crdate. use adventureworks select name, crdate, refdate from sysobjects where type = 'P' (or 'U') order by crdate Vincent ...Show All
Visual Studio Cannot add Reference shape to DSL Diagram
All of a sudden I cannot add Reference connectors (embedded or otherwise) to my diragram anymore. I click the reference tool, then click on an object in the diagram, and everything (all the toolbars/dockers) flashes like crazy for about 3 seconds, then nothing, I have no connecting line to move to my destination object... Ive tried reinstalling the DSL sdk, resetting all my VS environment toolbars... and fiddling with various settings but this problem just wont go away. Im using the April CTP.... Any ideas Thanks - Adam Langley Adam, Have you tried devenv /resetUserData (/rootSuff ...Show All
Visual C# Casting to nullable generics
Hi. I have this method: public static TVal DoIT<TVal>( object value) { return (TVal) Convert .ChangeType(value, typeof (TVal)); } But it fails in case of DoIt< DateTime >( DateTime .Now) . (Invalid cast from 'System.DateTime' to 'System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.) How can I make it working I was trying to catch that case myself (happy with typeof (TVal).IsNullable ), but I'm not able to create required nullable type because no constructor I found takes a System. Type (which I can get using Nullable .GetUnderlyingType ...Show All
Visual C++ Getting LNK4224 with B2 - what's the story?
Hi David! When building projects with VS2005 B2 I'm now seeing lots of these: mymodname.obj : warning LNK4224: /COMMENT is no longer supported; ignored While the message is straightforward, what's the story behind it The "/COMMENT" was marked as depricated in VC2003 and is now consequently removed... You should use " #pragma comment" instead. The reason might be: more C++ conform. -- Greetings Jochen Kalmbach Microsoft MVP VC++ My blog about Win32 and .NET http://blog.kalmbachnet.de/ PS: Please mark an answer as "answered" if it helped!!! ...Show All
