BUG - SQL 2008 DB Names Containing Control Characters

by jfisch 1. October 2010 07:03

Createc Connect Bug for an issue caused by a Visual Studio dialog adding a ASCII 127 character to a database name.

https://connect.microsoft.com/SQLServer/feedback/details/608963/database-names-containing-control-characters

You can't tell the difference between the names within Management Studio.

Vote for it if you like.

Tags: ,

SQL | SQL CLR

Silverlight Uninstaller Missing

by jfisch 30. August 2010 08:40

I just ran into a situation where I couldn't uninstall my version of silverlight because it was missing the right .msi.  I ended up looking in the right column of Programs and Features (control panel), looking up the silverlight installer location for that version in the Silverlight Release History, starting the installation just to extract the msi, look in C:\ for the install folder (named something like C:\75e0fa898bd7ca6), pointing the uninstaller's browse box at that directory for the correct version of the uninstaller.   I kept getting an error on a windows update after the uninstaller browse box would display and I'd cancel it, not knowing why it kept popping up.  Good luck to anyone with this issue!  Hopefully this gives some work-around steps.

Jeff

Tags: , ,

Silverlight

CertInstaller.exe Download

by jfisch 30. August 2010 06:41

This executable is not available for download.  Either I'm slow or it's poorly documented, but MSDN's documentation on certinstaller.exe doesn't make it completely clear where this exe can be found.  It's part of the Windows Mobile OS and it can be executed remotely using the rapistart.exe power toy.  Hopefully this finds it's way into windows mobile developer's hands who are having difficulty getting over this mental hurdle, as I did.

Jeff

Tags: , , , ,

Windows Mobile 6.5

Silverlight Control Resize

by jfisch 27. July 2010 19:23

I've been using Silverlight quite a lot lately and ran into some Silverlight control sizing issues while using MVVM.  The control being set to 100% width within the aspx page was causing issues.  Googling some, I saw several solutions, but none that were that descriptive.  To address my needs, I needed the silverlight control on the aspx page to resize based on dynamic changes within my framed MainPage.  Luckily, my frame for the simple project I'm working on is consuming the entire control, so there's no calculation needed to come up with the total control dimensions.

The basics of the approach were that I used some simple javascript for resizing the silverlight control on the page, passing in the updated height of the silverlight control.

function ResizeObject(height) {

    try {

        var slobject = document.getElementById("silverlightObject");

        slobject.style.height = height + "px";

        window.status = slobject.style.height;

    }

    catch (err) { }

}

I then needed to invoke this javascript on the page from within silverlight control itself.  Since I'm using MVVM and the Navigation Framework, my MainPage has a NavigationFrame on it.  I used the Navigated event on the NavigationFrame to get when the contents of the NavigationFrame have changed and used the Content property of the NavigationEventArgs within the event to get the control that it's being changed to.  I wire up an LayoutUpdated event to that control so I get when the internal control's layout is changing so I can change the "on the page" silverlight control's height (since this was specifically my issue).  Here's the code, enjoy!

void MainPage_Loaded(object sender, RoutedEventArgs e) {

    NavigationFrame.Navigated += new NavigatedEventHandler(NavigationFrame_Navigated);

}

 

private double _lastHeight = 0.0;

void NavigationFrame_Navigated(object sender, NavigationEventArgs e) {

    FrameworkElement element = e.Content as FrameworkElement;

    element.LayoutUpdated += (sender2, e2) => {

        if (element.RenderSize.Height > 0.0 && _lastHeight != element.RenderSize.Height) {

            HtmlPage.Window.Invoke("ResizeObject", new object[] { element.RenderSize.Height });

            _lastHeight = element.RenderSize.Height;

        }

    };

}

I eliminate unecessary updates to the control size by validating the Height is > 0 and I keep the state of the last height to make sure I'm not setting it to the existing size.

Jeff

Tags:

Recommended Reading - Delayed Start Services

by jfisch 13. January 2010 05:45

http://blogs.technet.com/askperf/archive/2008/02/02/ws2008-startup-processes-and-delayed-automatic-start.aspx

The last two paragraphs are particularly valuable and generally applicable.

Jeff

Tags:

Recommended Reading

SQL Server Object Search

by jfisch 3. December 2009 09:47

I had a request today for some code to search a SQL Server for an object throughout all of the database.  I thought I'd post the code I came up with just for future purposes and in case anyone is looking for something of the like:

DECLARE @ObjectName sysname, @SQL nvarchar(max)

SELECT @ObjectName = 'ImportBugs', @SQL = ''

) - 10)

PRINT @SQL

 

EXEC sp_executesql @SQL, N'@ObjectName sysname', @ObjectName = @ObjectName

Enjoy!

Jeff

Tags: , , , ,

T-SQL

Developer Pet Peeve Series - Conditional Boolean Assignment/Boolean Conditional

by jfisch 8. October 2009 07:54

Here's a snippet of code I see all of the time (simplified for example purposes):

bool checkStatus = false;

bool resultStatus = false;

if (checkStatus == true) {

(checkStatus) {

Next, it always bothers me when people choose to write long-hand versions of what could be shorthand.  IMHO, if you're going to choose to be a developer as a profession, you need to strive to learn and refine the process of development.  It doesn't bother me when I see novice developers code this way, but when I see tenured developers do it, there's no excuse.  Here's how I'd write the same long-hand solution above.

bool checkStatus = false;

bool resultStatus = (checkStatus);

Some people take this a step further than I do by condensing multiple lines of code onto a single line.  I definitely don't go this far, but I find "clean" coding far more preferable and efficient to read than verbose over-coding.

Happy Coding,

Jeff

Tags:

C#

SQL Server 2008 sp_help bug logged

by jfisch 7. October 2009 10:28

I've logged a bug against SQL Server 2008 for sp_help throwing errors on columns greater than 106 characters (I know, a bit of a stretch).  I was in the middle of writing some code for automating a data pull and ran into this.  If you're able, go and add to the repro count for the bug with the script I've attached.  It's really simple, it creates a two column table, runs sp_help on it then drops the table.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=496501

Thanks,

Jeff

Tags: , ,

SQL

Finding the scoftware blog within SQL Books Online and Visual Studio Help

by jfisch 18. September 2009 20:26

I thought I'd put a little tutorial together on how to find my site within SQL Books Online and Visual Studio Help, to hopefully make my site more accessible and more helpful to those who you use it regularly.

First, you need to setup BOL or VS Help to utilize online help as the primary resource.  When starting up BOL or VS Help for the first time you're prompted with the below dialogs, simply make the "Online" selections.

 

 

Then from within BOL or VS Help, click Search and enter your search term.  Here I've used the term 'query method' within SQL BOL to search for the sql xml data type query method.

 

After opening the search topic, browse to the bottom of the MSDN topic and you can see if I've written any particular community content for that particular MSDN article.

 

Simply click my blog link and you'll be home sweet home!

If you'd like to request I make any particular community content samples, examples, etc you're welcome to post the MSDN article as a comment for this post and I'll see what I can do it.  The same applies for Visual Studio.  If you already have BOL/Visual Studio running, then you should review your Help settings in Tools->Options->Environment->Help->Online (SSMS and VS).  Make sure to have "Try online first, then local" selected and reorder your search providers with MSDN Online at the top.

HTH,

Jeff

Tags: , ,

Development

hp director software download

by jfisch 17. September 2009 19:22

I searched endlessly for my HP LaserJet 3330 jet director download only to realize that I had the CD in one of my CD cases.  It's aparently not available for download (until now Wink).  Enjoy.

HPLaserJet3300.iso (459 M Bytes)

Tags:

Business

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen