Fun with site migration

Here is my latest headache: Server Error in ‘/’ Application. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance...

February 11th, 2009 by B.Harding 

Serializing and de-serializing a listbox to XML

In this post I will discuss how I stored a list of strings in a single database field as xml. The application I’m working on has a list of email addresses for each contact. Rather than creating a new table with forgein keys, stored procedures, Data access componants, and business layer logic I decided to take a regular email field and expand it to store a list of emails. My Datastore is SQL...

February 5th, 2009 by B.Harding 

Insert with FormView using Linq

I had a wierd error trying to insert data using a formview today. The jist is this: the formview was trying to use an empty string for an int field instead of Nothing. Here is the error I saw, helpful huh? Failed to set one or more properties on type xxxxxxx  Ensure that the input values are valid and can be converted to the corresponding property types. The fields are allowed to be null but...

February 5th, 2009 by B.Harding 

switch to ssl automatically

In this post I’ll explain how I transparently switch from http to https This same snipit can be put on any page as is and forces certain pages to be https. The nice thing about it is that the user can not edit the url back to http on a page that has this. All I did was put it on the login page and payment page. On page load the server examines the Request.IsSecureConnection flag and redirects...

February 5th, 2009 by B.Harding 

Ajax update panels and the errors that love them.

I have been using ajax a lot lately in my current project. I have noticed an annoying quirk. When a runtime error happens the page appears to hang. temprarily dissabling the update panel quickly reveals that the page isn’t really stuck, but there is an error that ajax is ignoring. I did some research and found a few good examples of how to handle the errors but most were in C# and some didn’t...

February 5th, 2009 by B.Harding 

email a gridview

In this post I’ll discuss how I coerced a gridview control into straight text.  The reason I did this was to send the data from the gridview in an email. An invoice in this case. At first I figured I could use a div and simply tap in to the inner html. No luck! It’s not available on the server side. I’d like to avoid the help of Javascript so I kept looking. I decided to make...

February 5th, 2009 by B.Harding 

How does the adrotator control’s imrpessions property work?

The msdn documentation was a little hazy on this subject. Here it is as I understand it…. Lets start from the beginning; and adrotator will take a list of images and rotate through them every time the page loads. Some ads may need to appear more often than others. That is where the Impressions property comes in. It allows to give some ads more weight than others. Perhaps one person is paying...

February 5th, 2009 by B.Harding