The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,858 other subscribers

Archive for February, 2012

Solution for Visual Studio 2010 VB.NET errors “Type ‘MyProject.My.MySettings’ is not defined.” and “MyProject’ is not a member of [Defalut]” #VS2010

Posted by jpluimers on 2012/02/29

(Note the WordPress bug: you cannot have <Default> in a topic title, but having it in the text is fine, hence the [Default] in the title).

When porting some projects from .NET 1.x to .NET 4.x, I got these two errors:

Error 17 Type 'MyProject.My.MySettings' is not defined.
Error 18 'MyProject' is not a member of '<Default>'.

Both errors in the file ...\My Project\Settings.Designer.vb relative to the MyProject.vbproj file.

This was not the result of something like this Visual Studio 2005 bug, but of how the designer generated files are not being regenerated when you change the root namespace only in the MyProject.vbproj file, not through the IDE.

Steps to reproduce:

  1. Create a MyProject class library in VB.NET
  2. In the MyProject.vbproj, change the RootNameSpace into MyNameSpace.MyProject.vbproj
  3. Build

Lesson learned: when using text compare tools, some .vbproj changes should be propagated through the IDE, not through your favourite text compare tool.

When you change it in the IDE, it regenerates the *.Designer.vb files to reflect the changed namespace.

The solution is simple, in the IDE follow these steps:

  1. In the Project Options change the RootNameSpace to a dummy
  2. Build your project
  3. Chante the RootNameSpace to what you want
  4. Build your project

–jeroen

via: type “my.mysettings” “is not defined.” – Google Search.

Posted in .NET, Development, Software Development, VB.NET | Leave a Comment »

P/Invoke: usually you need CharSet.Auto (via: .NET Column: Calling Win32 DLLs in C# with P/Invoke)

Posted by jpluimers on 2012/02/28

I don’t do P/Invoke often, and somehow I have trouble remembering the value of CharSet to pass with DllImport.

In short, pass CharSet.Auto unless you P/Invoke a function that is specific to CharSet.Ansi or CharSet.Unicode. The default is CharSet.Ansi, which you usually don’t want:

when Char or String data is part of the equation, set the CharSet property to CharSet.Auto. This causes the CLR to use the appropriate character set based on the host OS. If you don’t explicitly set the CharSet property, then its default is CharSet.Ansi. This default is unfortunate because it negatively affects the performance of text parameter marshaling for interop calls made on Windows 2000, Windows XP, and Windows NT®.

The only time you should explicitly select a CharSet value of CharSet.Ansi or CharSet.Unicode, rather than going with CharSet.Auto, is when you are explicitly naming an exported function that is specific to one or the other of the two flavors of Win32 OS. An example of this is the ReadDirectoryChangesW API function, which exists only in Windows NT-based operating systems and supports Unicode only; in this case you should use CharSet.Unicode explicitly.

–jeroen

via: .NET Column: Calling Win32 DLLs in C# with P/Invoke.

Posted in .NET, Ansi, C#, Delphi, Development, Encoding, Prism, Software Development, Unicode | 3 Comments »

won’t work on a ThinkPad W701: DisplayPort Adapter Cables 45J7915, 57Y4393 Compatibility – ThinkPad W700/W701

Posted by jpluimers on 2012/02/27

Dang this won’t work:

The ThinkPad W700/W701 DisplayPort is a DisplayPort-only source, not a Dual-Mode source, and thus cannot support the DisplayPort adapter cables.

See also this PDF:

ThinkPad W701, W701ds Multiple Monitor Configurations
Boost productivity, view more data
** DisplayPort to Single-Link DVI (45J7915) or VGA (57Y4393) monitor cables are not supported on the W701 DisplayPort

–jeroen

via: DisplayPort Adapter Cables 45J7915, 57Y4393 Compatibility – ThinkPad W700/W701.

Posted in Power User, ThinkPad, W701 | Leave a Comment »

ThinkPad W701 with 32GB of memory via: forum.thinkpads.com • Newer 8G memory sticks in a W700, W701, W500, W510 ?

Posted by jpluimers on 2012/02/27

Just as a mental note: it is possible to put 32GB of memory in a ThinkPad W701:

for a while now, 32GB on 2x W701

–jeroen

via: forum.thinkpads.com • Newer 8G memory sticks in a W700, W701, W500, W510 ?.

Posted in Power User, ThinkPad, W701 | Leave a Comment »

Scott Adams uses a Wacom Cintiq 24HDI for his drawing.

Posted by jpluimers on 2012/02/24

Recently, I noticed that Scott Adams uses a Wacom Cintiq 24HD to do his art work:

I do all of my drawing directly to the computer screen of my Wacom Cintiq 24HD. I literally feel sympathy for any artist who still works with pen and paper. The system cuts my production time in half and allows me to do better work too. If youre an artist, and youre still drawing on paper, youre like the seventy-year old author who swears by his manual typewriter.

Great gadget that has it price, but loved by artists.

–jeroen

via: Scott Adams Blog: Today I Review Everything 02/10/2012.

Posted in LifeHacker, Opinions, Power User | Leave a Comment »

VMware View Client uses PCoIP; please network admins read the PCoIP checklist!

Posted by jpluimers on 2012/02/24

Somehow, I have the impression that not all VMware View Client network admins fully read and understand the “PCoIP Protocol Virtual Desktop Network Design Checklist

That checklist is important, as it is easy to get things wrong and dissatisfy your users without reason (heck, they get worse than mediocre RDP performance experience, so you could’ve saved you the work of PCoIP in the first place).

So please do read the “PCoIP Protocol Virtual Desktop Network Design Checklist“.

It starts with

The PCoIP protocol provides a real-time delivery of a rich user desktop experience in virtual desktop and remote workstation environments.

To ensure a responsive desktop, the PCoIP protocol must be deployed across a properly architected virtual desktop network infrastructure that meets bandwidth, QoS, latency, jitter, and packet loss requirements.

CheckPoint VPN sometimes can be a dork combined with PCoIP. and at least make sure UDP works well over your VPN.

–jeroen

via: “PCoIP Protocol Virtual Desktop Network Design Checklist

(Some more backgorund reading and even more)

(fixed typo: one of the PCoIP occurances was PCiOP, luckily, Google knows better :)

Posted in Power User, View, VMware | 2 Comments »

SQL Server 2000: How do I register multiple databases with Microsoft SQL Server Enterprise Manager?

Posted by jpluimers on 2012/02/24

I’m in the midst of a big migration traject.

One class of systems involved in the migration is SQL Server 2000 databases (yes, I know that SQL Server 2000 has been in Extended Support mode since April 8, 2008, that’s one of the grounds for migration).

Sometimes, you need SQL Server Enterprise Manager (a plugin to the Microsoft Management Console) to work on those databases to see what needs to be migrated (yes, this should be in the documentation, of which the ultimate form is the system itself ;-).

SQL Server Enterprise Manager has a nice feature that you can group SQL Server registration into SQL Server Groups.

However, it also has a limitation: you cannot add the same SQL Server to multiple SQL Server Groups. That is: unless you create an alias on the SQL Server, as aliases are not counted in the “unique” criterion.

Below are the top 2 links I found using “multiple databases” “sql server”  “enterprise manager”. Since I’m not sure the content of those will last, below are the full quotes.

Besides adding a SQL Server Alias (which has other uses as well), the most important steps are “6” in the first quote, and “1.6” in the second quote: your alias needs to point to the same IP address (or hostname) as your regular server.

How do I register multiple databases with MS SQL Enterprise Manager?

MS Enterprise Manager does not allow you to register the same database server multiple times. It is sometimes useful to create multiple registrations, if you want to connect to different databases on the same server. To workaround this, follow the steps below.

  1. Go to Start – Programs – Microsoft SQL Server – Select “SQL Server Client Network Utility”
  2. Go to Alias Tab
  3. Click “Add”
  4. In the “Server alias:” text box, enter a name you want to use to distinguish this database server
  5. In the “Network libraries:” section, select “TCP/IP”
  6. In the “Connection parameters” section, change the “Server name:” to your database server, i.e.; mssql01.discountasp.net
  7. Click OK

Once the Alias is created, you can register it using the same method described in this Knowledge Base article.

How can I open multiple databases in SQL Server Enterprise Manager?

  1. Create SQL Server Alias
    (Please repeat the following steps if you want to open mutiple databases)

    1. Open SQL Server Client Network Utility.
    2. When Client Network Utility opens, click on the Alias tab.
    3. Click on the Add button.
    4. In the Server Alias text box enter a name for your SQL connection.
    5. Select TCP/IP under Network libraries
    6. Enter the IP address of the Server your SQL database is located on, in the Server name text box.
    7. Click on the OK button.
    8. Your Server alias will now be configured, click on the Apply button.
    9. Click on the OK button.
  2. Create SQL Server Connection in Enterprise Manager
    (Please repeat following  steps if you want to open mutiple databases)

    1. Open SQL Server Enterprise Manager.
    2. When Enterprise Manager opens, right click SQL Server Group and select New SQL Server Registration.
    3. The Register SQL Server wizard will now open.
    4. Click on the Next button.
    5. From the Available Servers drop down menu, select the server alias you created earlier.
    6. Click on the Add button.
    7. The server should now be listed under Added servers, click on the Next button.
    8. When the next dialog box appears select The SQL Server login information that was assigned to me by the system administrator see above.
    9. Click on the Next button.
    10. Enter your Login name and Password ? this will be used every time you connect to your SQL server.
    11. Click on the Next button.
    12. Ensure that Add the SQL Servers to an existing SQL Server group is selected and SQL Server Group is selected for Group name.
    13. Click on the Next button.
    14. When the next dialog box opens you can click on the Finish button.
    15. Your SQL Connection will now be created.

–jeroen

via:

Posted in Database Development, Development, SQL, SQL Server, SQL Server 2000 | 1 Comment »

WordPress XML sourcecode help needed; forum posts gets deleted.

Posted by jpluimers on 2012/02/23

Please one of the WordPress.com support people, contact me through my contact form.

I tried posting this question, but as you can see it is marked as ‘Topic Closed, This topic has been closed to new replies’, and looks empty on your forums’:

Please stop deleting the XML from my

</h1>
Since WordPress deletes anything but the most basic XML from 

tags:

See https://wiert.me/wp-content/uploads/2012/02/wordpress-html.doc

When I put that in a WordPress post, it deletes the XML.
It does this for anything but the most basic XML.

Please fix that!

–jeroen

Thanks in advance!

–jeroen

Posted in Development, SocialMedia, Software Development, Web Development, WordPress, WordPress | 2 Comments »

Bitcricket IP Subnet Calculator

Posted by jpluimers on 2012/02/23

When routing networks, one of the important things to get right is your IP subnets.

Doing the math from your head is hard, and I usually used some subnet calculator web pages, but recently stumbled over the great [Wayback] Bitcricket IP Subnet Calculator.

IP Subnet Calculators … pioneered byby Bitcricket founder J. Scott Haugdahl …  rewrite of this tool, improving upon the precedent set by the original with a refreshed GUI, native Windows or Mac operation, and support for IPv6.

As the quote tells, it is running on both Windows and Mac, so I took a quick look and found that the underlying technology is Qt with a C++ application layer. That reminds me of the old Kylix days :)

–jeroen

via: [Wayback] IP Subnet Calculator – Overview.

Posted in Power User | Leave a Comment »

C#/.NET: Assessing the SqlException severity

Posted by jpluimers on 2012/02/22

When handling SqlExceptions in C#, it is wise to assess the Class, as it indicates the severity.

Some classes are user error, others are fatal, etc.

This extension class will help you:

using System;
using System.Data.SqlClient;

namespace bo.MsSql
{
    /// <summary>
    /// see http://msdn.microsoft.com/en-us/library/ms164086.aspx
    /// </summary>
    public static class SqlExceptionSeverety
    {
        public static bool IsInformational(this SqlException sqlException)
        {
            return sqlException.Class < 10;
        }

        public static bool IsUserCorractable(this SqlException sqlException)
        {
            return (sqlException.Class >= 10) && (sqlException.Class < 17);
        }

        public static bool IsSoftwareError(this SqlException sqlException)
        {
            return (sqlException.Class >= 17) && (sqlException.Class < 20);
        }

        public static bool IsFatalSystemProblem(this SqlException sqlException)
        {
            return sqlException.Class >= 20;
        }
    }
}

–jeroen

Posted in .NET, C#, Development, Software Development | Leave a Comment »