
12.27.2004
Re-throwing in .NET C#
I guess there's a difference between throw ex (throwing the exception you received) and throw.
Haven't read this, but need to. I think I do a few "throw ex" calls around my code... :)
Signs on the Sand: Re-throwing exceptions - a subtle difference between Java and .NET you better be aware of
Haven't read this, but need to. I think I do a few "throw ex" calls around my code... :)
Signs on the Sand: Re-throwing exceptions - a subtle difference between Java and .NET you better be aware of
Working from home and VS.net plugins
Decent blog page with some VS.NET thoughts.
-- Use second machine as a second monitor.
-- DSWatch - quickwatch in VS.NET debugger for a DataSet (see previous blog entry)
-- VSFileFinder VS.NET extension
-- CodeSmith
-- UnleashIT
-- Bracket Matching macro
Working from home and VS.net plugins
-- Use second machine as a second monitor.
-- DSWatch - quickwatch in VS.NET debugger for a DataSet (see previous blog entry)
-- VSFileFinder VS.NET extension
-- CodeSmith
-- UnleashIT
-- Bracket Matching macro
Working from home and VS.net plugins
Debugging QuickWatch for DataSet
Extensibility project for VS.NET -- shows a quickwatch control with the contents of a DataSet during debugging.
The Code Project - Special QuickWatch for a DataSet - C# Programming
The Code Project - Special QuickWatch for a DataSet - C# Programming
SQL Stored Proc - ANSI_NULLS
I've mostly known this :) , but here's the documentation to prove it, and to keep straight which settings are kept from creation and which are used on-the-fly.
A SQL Stored Proc keeps the ANSI_NULLS and QUOTED_IDENTIFIER settings from when the SP was created. However, other settings such as ANSI_WARNINGS, ANSI_PADDINGS are used from the current connection settings.
Transact-SQL Reference (search for ANSI_NULLS)
alternate keywords: SP storedproc sproc
A SQL Stored Proc keeps the ANSI_NULLS and QUOTED_IDENTIFIER settings from when the SP was created. However, other settings such as ANSI_WARNINGS, ANSI_PADDINGS are used from the current connection settings.
Transact-SQL Reference (search for ANSI_NULLS)
alternate keywords: SP storedproc sproc
12.23.2004
FeedBurner Publishing RSS Feed
Stumbled across FeedBurner.com while checking out Leo Laporte's blogs about KFI radio show.
Anyway - Feedburner grabs an RSS or ATOM feed, and formats into a browser friendly, readable page. Free for now, and churns out a pretty nice looking page.
All Things .NET - powered by FeedBurner
Anyway - Feedburner grabs an RSS or ATOM feed, and formats into a browser friendly, readable page. Free for now, and churns out a pretty nice looking page.
All Things .NET - powered by FeedBurner
12.22.2004
Implicit Distributed Transaction with Linked Server Exec SP
Ugh...ran across this today at work. I'm using a linked server (MSDE client to SQL2000 server) and the statement is "insert into xxx exec remoteserver.dbName.dbo.someSP..."
Apparently, the "insert into foo exec bar..." syntax causes an implicit distributed transaction to be started. This is tricky for me, since my client machines may not always be running MSDTC, headaches with firewall and dist transactions, etc.
Google Groups : microsoft.public.sqlserver.connect
Looks like my only other choice is go back to building a string and then OPENQUERY.
Apparently, the "insert into foo exec bar..." syntax causes an implicit distributed transaction to be started. This is tricky for me, since my client machines may not always be running MSDTC, headaches with firewall and dist transactions, etc.
Google Groups : microsoft.public.sqlserver.connect
Looks like my only other choice is go back to building a string and then OPENQUERY.
12.20.2004
Save Toolbar Settings in VS.NET
Well, unfortunately, it sounds like you can't! :(
Not sure how this happened, but I fired up VS.NET a couple days ago, only to find out my custom toolbars and keyboard shortcut key assignments were all gone!??
I've tried to find this before without success. Filemon, RegMon spew out so much data just for devenv.exe that it's like finding a needle in a haystack.
The good news - apparently in VS.NET 2005, exporting custom settings is supported.
This search turned up some info from some MS dudes that tried for weeks to figure out where the settings are saved. Apparently, not possible - quote from ms devs.
One little tidbit, the file for the toolbar customizations (apparently based on Office toolbar technology) is possibly stored in
<docs and settings user profile>\Application Data\Microsoft\VisualStudio\7.1\1033\CmdUI.PRF
This is a binary file, so not easy to understand, but did confirm that it changes when I tweak a toolbar in VS.NET. :)
Not sure how this happened, but I fired up VS.NET a couple days ago, only to find out my custom toolbars and keyboard shortcut key assignments were all gone!??
I've tried to find this before without success. Filemon, RegMon spew out so much data just for devenv.exe that it's like finding a needle in a haystack.
The good news - apparently in VS.NET 2005, exporting custom settings is supported.
This search turned up some info from some MS dudes that tried for weeks to figure out where the settings are saved. Apparently, not possible - quote from ms devs.
One little tidbit, the file for the toolbar customizations (apparently based on Office toolbar technology) is possibly stored in
<docs and settings user profile>\Application Data\Microsoft\VisualStudio\7.1\1033\CmdUI.PRF
This is a binary file, so not easy to understand, but did confirm that it changes when I tweak a toolbar in VS.NET. :)
12.15.2004
Process.Start exception when give URL
Ran across a weird exception when calling
System.Diagnostics.Process.Start( "http://www.someplace.com" );
Exception message:
The requested section was not present in the activation context
Apparently, the thread trying to start the browser must be marked STAThread.
Simply added [STAThread] attribute to the main() function, and all worked fine.
Google Groups : microsoft.public.dotnet.languages.csharp
Well, the next search result explains it more fully. Apparently, using the ProcessStartInfo parameter version of Process.Start to avoid having to set the thread apartment state.
MSDN Help on Process.Start talks about the need to set STAThread when using ProcessStartInfo.UseShellExecute set to true, or when passing a path to Process.Start()
I'm a bit confused, cuz it crashes for me when I don't have STAThread on main(), and pass a url string...but then it works by setting ProcessStartInfo.UseShellExecute to true.
System.Diagnostics.Process.Start( "http://www.someplace.com" );
Exception message:
The requested section was not present in the activation context
Apparently, the thread trying to start the browser must be marked STAThread.
Simply added [STAThread] attribute to the main() function, and all worked fine.
Google Groups : microsoft.public.dotnet.languages.csharp
Well, the next search result explains it more fully. Apparently, using the ProcessStartInfo parameter version of Process.Start to avoid having to set the thread apartment state.
MSDN Help on Process.Start talks about the need to set STAThread when using ProcessStartInfo.UseShellExecute set to true, or when passing a path to Process.Start()
I'm a bit confused, cuz it crashes for me when I don't have STAThread on main(), and pass a url string...but then it works by setting ProcessStartInfo.UseShellExecute to true.
ASP.NET Trace Output
Just a reminder on how to enable tracing for an ASP.NET page. Easy, turn it on in the page directive, then can use Trace.Write, Trace.Warn, etc. throughout your page code.
Can also later view the output with the axd trace viewer.
See "Trace object [ASP.NET]" in MSDN help for more info.
<% @Page language="c#" Trace="true" %>
<%
Trace.Warn( "here" );
%>
Can also later view the output with the axd trace viewer.
See "Trace object [ASP.NET]" in MSDN help for more info.
12.07.2004
VS.NET Debugger Data Tooltips
Remember the good ol' AutoExp.dat file from Visual Studio 6? It's the config file for how the debugger shows tooltips for various datatypes at debug time.
I've made it all these years with Visual Studio .NET not remembering about this gem. They've changed it slightly for VS.NET 2002/2003, but it's basically the same idea.
Look for mcee_cs.dat in the install dir\common7\packages\debugger directory. Fairly good notes at the top of the text file. Add your custom types at the bottom.
example:
I've made it all these years with Visual Studio .NET not remembering about this gem. They've changed it slightly for VS.NET 2002/2003, but it's basically the same idea.
Look for mcee_cs.dat in the install dir\common7\packages\debugger directory. Fairly good notes at the top of the text file. Add your custom types at the bottom.
example:
<CallawayGolf.OrderTool.Order>=ID=<id> Acct=<accountName> PO=<poNum>p.s. Looks like this needs a restart of the VS.NET IDE to take effect.
Visual Studio Debugger - NoStepInto
Looking into the next generation of autoexp.dat for VS.NET 2003. Can't believe I made it this long without using any of these undocumented features. Anyway, along the way, I happened upon the old NoStepInto feature. Turns out they bailed that for VS.NET, in favor of the DebuggerHidden attribute.
Here's good info for those poor souls wanting to do the NoStepInto with VC++ debugger.
Andy Pennell's Blog - Friday, February 06, 2004 Entries
(bottom line, in case this page dies)
HKCU\Software\Microsoft\VisualStudio\7.1\NativeDE\StepOver
(have to create last 2 keys)
10=ATL\:\:.*=nostepinto
Line numbers are just so that debugger evals these in *descending* order.
Next is regex for the function(s) to match. (remember to RegEx escape any necessary)
Right side of = is either nostepinto or stepinto
Remember to double check the name of a particular function via the debugger at runtime. Often times, it's mangled, or namespaced differently than what you'd expect.
Here's good info for those poor souls wanting to do the NoStepInto with VC++ debugger.
Andy Pennell's Blog - Friday, February 06, 2004 Entries
(bottom line, in case this page dies)
HKCU\Software\Microsoft\VisualStudio\7.1\NativeDE\StepOver
(have to create last 2 keys)
10=ATL\:\:.*=nostepinto
Line numbers are just so that debugger evals these in *descending* order.
Next is regex for the function(s) to match. (remember to RegEx escape any necessary)
Right side of = is either nostepinto or stepinto
Remember to double check the name of a particular function via the debugger at runtime. Often times, it's mangled, or namespaced differently than what you'd expect.