Feed Icon  

Contact

  • Bryant Likes
  • Send mail to the author(s) E-mail
  • twitter
  • View Bryant Likes's profile on LinkedIn
  • del.icio.us
Get Microsoft Silverlight
by clicking "Install Microsoft Silverlight" you accept the
Silverlight license agreement

Hosting By

Hot Topics

Tags

Open Source Projects

Archives

Ads

Page 1 of 6 in the SqlAndXml category(RSS) Next Page

Migrated from Community Server to DasBlog

Posted in Community Server | dasBlog | Sql and Xml at Saturday, October 17, 2009 8:30 AM Pacific Daylight Time

If you’re reading this then you’re on my new blog homepage at http://bryantlikes.com. I’ve wanted to move off of http://blogs.sqlxml.org for some time but every time I start to work on it I get overwhelmed by the amount of work involved. I would usually get stuck on (1) how to migrate all my content and (2) where to host it since there is a lot of content and most hosting providers give you very little SQL storage.

I looked at a lot of options and even setup Oxite on Azure by following this guide, but since I didn’t know what the monthly costs will be I decided not to take that route. Since I was recently awarded the MVP award I decided to look at some of the benefits and I found that Orcs Web offers a free hosting account to MVPs. I know Orcs has a great service so I was excited to give that a try, but I didn’t think their SQL storage would be enough for my blog. That is when I got the idea to give dasBlog a try. DasBlog stores all your data in xml files instead of using a SQL database. At first that sounds like a bad idea, but if it can support Hanselman’s blog, then surely my blog would have no problems at all. Plus it solves the SQL storage issue.

Now the harder question, how do you migrate all the content. At first I tried using the BlogML stuff to pull all my content out of Community Server, but I have a lot of content so I ended up getting lots of exceptions. I tried to hand code some solutions, but finally gave up. Then I got the idea to just take the simple route and write a custom program to read the data from my CS database and generate the XML files that dasBlog uses. So I used some Linq to SQL classes and wrote the XML using Linq to XML. It was fairly easy to do and it worked great.

The next step was to setup the redirects on the old site to point to the new site. I have all the articles redirecting and I think they all work (for the most part). I had to setup some custom redirects for some of the articles with non-standard characters in the titles, but other than that it was pretty easy. I also followed Scott’s post on canonicalize my URLs and using IIS7’s rewrite module. Orcs provides access to your IIS7’s manager remotely which works great.

I still need to migrate my articles, but I’ll get those done later today. Other than that it is a done deal. I’m very happy to be off the sqlxml.org domain which I still host at home and to be off of Community Server.

Lately, I wanted to thank Alexander Groß for the great theme which he created. I think this new blog is much easier to read and so far I’ve enjoyed the dasBlog software. I’ve even write a custom macro to put the RSS feeds on the category pages. I’m sure I’ll do some more customization down the road and post about as I go.

Hope you like the new blog!

Beta Exam Extravaganza

Posted in Sql and Xml | SharePoint | Certifications | Vista at Tuesday, December 12, 2006 10:28 AM Pacific Standard Time

From LLiu on the SharePoint Team Blog

You are invited to take the following exams in their beta versions. If you pass either or both of the beta exams, the exam credit will be added to your transcript and you will not need to take the exam in its released form.

·         Exam 70-542: Microsoft Office SharePoint Server 2007 – Application Development

o    Counts as credit towards Microsoft Certified Technology Specialist: Microsoft Office SharePoint Server 2007: Application Development

·         Exam 70-541: Microsoft Windows SharePoint Services 3.0 - Application Development

o    Counts as credit towards Microsoft Certified Technology Specialist: Microsoft Windows SharePoint Services 3.0: Application Development

Plus I noticed that both the exams for the MCITP: BI certification are available and a few Windows Vista exams too.

  • 071-445 - TS: Microsoft® SQL Server 2005 Business Intelligence - Implementation and Maintenance
  • 071-446 - PRO: Designing a Business Intelligence Infrastructure by Using Microsoft® SQL Server 2005
  • 071-621 - UPG: Upgrading your MCDST Certification to MCITP Enterprise Support
  • 071-622 - PRO: Installing, Maintaining, Supporting, and Troubleshooting Applications on the Microsoft® Windows Vista Client - Enterprise
  • 071-624 - TS: Deploying and Maintaining Vista Client and Office 12 System Desktops using the BDD

The promo code for all these exams seems to be BTA + last three digits of the exam number (071-445 would be BTA445). If you've been working with these technologies then the beta exams are a great deal since they are free and even if you don't pass at least you know what you need to study.

Enabling WPF Magic Using WCF - Part 3

Posted in Sql and Xml | WCF | WPF at Thursday, September 21, 2006 6:45 AM Pacific Daylight Time

In Part 1 we created a simple WPF application that demonstrated WPF's ability to automatically update bindings and in Part 2 we extended the application to use WCF by using callbacks to notify WPF of the changes. In this part we will get rid of the XML file and move our application to use a SQL Server 2005 database for storage. In doing so we will replace the file system watcher with a SQL Notification. In order to learn about SQL Notifications I would suggest this article for a good overview and this article for code examples.

The first thing we will do is create our database. To do this I used VS Database Professional which is currently at CTP5. Below are the steps to create this database in VSDP:

  1. Create a new SQL Server 2005 project called ContactData
  2. In the project properties check the box for "Enable Service Broker"
  3. Add a new table called Contact (definition shown below)

The contact table is very similar to our contact XML data:

create table [dbo].[Contact]
(
    ContactID int identity(1,1) primary key not null, 
    FirstName nvarchar(50) not null,
    LastName nvarchar(50) not null,
    Phone nvarchar(15) not null
);

In the project I also edited the Scripts\Post-Deployment\Script.PostDeployment.sql script to add in our default contacts:

insert into Contact values ('Tom', 'Jones', '800-333-1111')
insert into Contact values ('Jill', 'Smith', '800-222-1111')
insert into Contact values ('Ed', 'Baker', '877-666-1111')
insert into Contact values ('Mary', 'Johnson', '866-777-1111')

Now we just right click our database project and select "Deploy". The database should get created and our table should get created and populated. Note: if you're not using VSDP you can still manually create the database and table and enable service broker following the instructions in the first article.

Now that we have a database to connect to we need to update our app.config file for our WCF service with the connection string. Below is the updated config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
    <add name="cDB" 
       connectionString="Database=ContactData;Server=(local);
Integrated Security=SSPI;"
       providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.serviceModel>...</system.serviceModel>
</configuration>

After we've added the connection string to the database we can reference it in our ContactProvider class as follows:

private static readonly string ConnStr = 
  ConfigurationManager.ConnectionStrings["cDB"].ConnectionString;

Now that we have a connection string we can pull the contacts from the database and return them to the client. To do this we will create a new method called GetClientsFromDb as shown below:

private List<Contact> GetContactsFromDb()
{
  List<Contact> contacts = new List<Contact>();
  using (SqlConnection conn = new SqlConnection(ConnStr))
  {
    SqlCommand cmd = new SqlCommand(
      "select ContactID, FirstName, LastName, Phone from dbo.Contact", 
      conn);
 
    conn.Open();
    IDataReader dr = cmd.ExecuteReader();
 
    while (dr.Read())
    {
      Contact c = new Contact();
      c.FirstName = dr.GetString(1);
      c.LastName = dr.GetString(2);
      c.Phone = dr.GetString(3);
      contacts.Add(c);
    }
  }
  return contacts;
}

Normally we would use something like Enterprise Library to deal with the data access, but since this is a very simple example I just used the standard SqlClient objects. All we are doing is pulling all the contacts from the database and returning them as a list of Contact objects. Notice that the t-sql is very specific with column naming and table referencing, this will be important later when we add our Sql Dependency object. At this point we could return this to the client by changing GetContacts to use this method instead of the GetContactsFromFile method. However, let's continue to move forward and add in our Sql Dependency now. Below is the updated class definition for the ContactProvider class:

namespace ContactService
{
  public class ContactProvider : IContactProvider, IDisposable
  {
    private static readonly string ConnStr = ...        
    private SqlDependency _sqlDep;
    private List<Contact> _contacts;
 
    public ContactProvider()
    {
      SqlDependency.Start(ConnStr);
    }
 
    private static List<IListChangedCallback> _callbacks = ...
 
    public List<Contact> GetContacts()
    {
      ... 
      if (_contacts == null)
      {
        _contacts = GetContactsFromDb();
      }
 
      return _contacts;
    }
 
    private List<Contact> GetContactsFromDb()
    {
      ...
      SqlCommand cmd = new SqlCommand(...);
 
      _sqlDep = new SqlDependency(cmd);
      _sqlDep.OnChange += OnListChanged;
 
      conn.Open();
      ...
    }
 
    private void OnListChanged(object sender, EventArgs e)
    {
      if (_callbacks.Count > 0)
      {
        _contacts = GetContactsFromDb();
        Action<IListChangedCallback> invoke =
          delegate(IListChangedCallback callback)
          {
            callback.OnCallback(_contacts.ToArray());
          };
        _callbacks.ForEach(invoke);
      }
    }
 
    public void Dispose()
    {
      SqlDependency.Stop(ConnStr);
    }
  }
}

I've highlighted the changed in bold, hopefully you can see them. The first thing to note is that the class now implements IDisposable. This is to enable use to call SqlDependency.Start when the class is contructed and to call SqlDependency.Stop when the class is disposed. This is done, to quote Sanchan Sahai Saxena in the article above, to "create the necessary queue, service and procedure and starts a listener to monitor the queue".

The next item to note is that when we get our initial list of contacts we are creating the dependency object using the same command. This ensures us that when any item in our list of contacts changes the dependency will be fired. We are also storing the list of contacts locally to avoid hitting the database multiple times. The dependency object's Change event is then wired to our OnListChanged event handler.

Finally we update our OnListChanged method to pull the contacts from the database and make the callback to the client with the updated list of contacts. To test the application fire up the service and then one or more of the client applications. Then open the table using SQL Server Management Studio and update/insert/delete records in the table. The results should be reflected almost instantly in the client applications. That's it!

Hopefully this has been a helpful series that demonstrates some of the cool features in both WCF and WPF (and SQL Server 2005). It has been a good learning experience for me. As we progress on our real application using some of these techniques I will try to add to this example.

Technorati Tags: WPF WCF Sql Server

Install Database Pro CTP5 w/o SQL Express

Posted in Sql and Xml at Wednesday, August 30, 2006 7:50 AM Pacific Daylight Time

As I mentioned in a prior post, VS Database Professional CTP5 requires you to install SQL Server Express as part of the setup. On my current project I just started to do some database work so I really wanted the CTP installed, but I didn't want to install SQL Server Express on my virtual machine since I already have a full blown SQL Server installation running. So with some help from Regmon I figured out what registry key the installer was looking for.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL]
"SQLEXPRESS"="MSSQL.1"

Now run the installer again and it should skip the SQL Express install. You will have to change some settings in Visual Studio under Options -> Database Tools -> Design-time Validation Database to be the correct SQL instance since you won't have express running. Also, you can delete the registry key once you get everything installed.

NOTE: Don't modify the registry if you don't know what you're doing. :)

You can download the registry file here.

Technorati Tags: SQL Server - Datadude - Development

VS Database Professional CTP5

Posted in Sql and Xml at Monday, August 21, 2006 3:51 AM Pacific Daylight Time

The CTP5 is now available. I'm installing it right now and I already have a complaint.

<rant>
Why do you force me to install SQL Express when I already have SQL Developer installed!?!?!
</rant>

I don't want to install SQL Express, but it seems that datadute, along with ASP.Net, makes my life difficult without it. Is there some way to avoid the SQL Express installation? I thought we had already discussed this...

Update: I figured out a way around this and posted it here.

Technorati Tags: - -

YAC

Posted in Sql and Xml | Certifications at Monday, July 17, 2006 9:43 AM Pacific Daylight Time

Yet Another Certification....

Just passed 70-442 on Friday. I think I'm done taking Microsoft exams for a little while. At least until the Mobile 5 exam comes out...

Microsoft Certified Technology Specialist for SQL Server 2005

Posted in Sql and Xml | General | Certifications at Thursday, April 27, 2006 2:50 AM Pacific Daylight Time

Last weekend I took exam 70-431 and passed so now I'm a MCTS: SQL Server 2005. That is a long title. Don't worry Scott, I won't be adding that to my signature. :)

If you're wondering about the exam, it wasn't too much different than the SQL Server 2000 exam (70-229), but included all the new SQL Server 2005 goodies like the xml data type and service broker.

Some PDC Linqs

Posted in Sql and Xml | BizTalk | General | ASP.Net/Web Services | Avanade at Friday, September 16, 2005 3:07 AM Pacific Daylight Time

I am at the PDC have a great time. I haven't posted anything simply because I've been way too busy and so I'm just soaking everything in. I'm planning on posting my thoughts soon (if you care).

In the meantime here are a few links that point to things I've been checking out:

In addition I've been looking at the BizTalk 2006 talks, some of the WCF and WWF talks, and some of the Team System talks. Hopefully I'll have time to post more on all this later.

Update: A few more linqs:

Master of Some

Posted in Sql and Xml | Reporting Services | SharePoint | BizTalk | General | Avanade | Test-Driven Dev at Thursday, September 01, 2005 4:05 AM Pacific Daylight Time

From Clemmens talking about technology overload:

Enter VS2005 and the summary of trying to achieve the same knowledge density is: “Frustrating”.

I feel his frustration. I remember going to PDC 2003 and realizing that it was getting very hard to keep up on all the new stuff coming out of Microsoft. Clemmens continues...

For “generalists” like me, these are hard and frustrating times if they’re trying to stay generalists. Deep and consequent specialization is a great opportunity for everyone and the gamble is of course to pick the right technology to dig into and become “the expert” in. If that technology or problem space becomes the hottest thing everyone must have – you win your bet. Otherwise you might be in trouble.

This statement not only applies to technology in general, but also to specific technologies: think SQL Server 2005. As Kimberly Tripp says, you must become a “Jack of all trades, master of some”. The hard part, as Clemmens mentions, is chosing the some.

For me it all comes down to what I'm working with. For instance, I just found out today that I will not be getting renewed as a Microsoft MVP for SQL Server. I expected this because I haven't had the time to contribute much to the SQL Server community lately. I tend to contribute based on what I'm currently working on. I haven't been a project that used SQL Server 2005 yet, so I haven't had time to really dig into it. If you read this blog you can probably figure out what kind of projects I have been on recently: a SharePoint (and RS) project last year and mostly BizTalk projects this year. I learn based on need.

I'm sure at some point in the near future (at least I keep telling myself this) I'll have time to dig into the new SQL Server 2005 and Visual Studio 2005 stuff (team system and all), but for now I'm pretty much focused on BizTalk 2004, test-driven development,  continuous integration, etc., since that is where I'm at.

I'll miss hanging out with the other SQL Server MVPs who are a great bunch of guys, but it has been fun being an MVP for the last five years.

Get Ready for SQL Server 2005 Roadshow Redux

Posted in Sql and Xml | Reporting Services at Tuesday, July 19, 2005 11:04 AM Pacific Daylight Time

There is another Get Ready for SQL Server 2005 Roadshow going on:

The Get Ready for SQL Server 2005 Roadshow was a huge success last
spring, so we're extending the tour to 15 more cities this summer and
fall, starting in Portland on July 26. Once again, we invite you as our
guest to attend any venue of the roadshow tour, which kicks off in
Portland on July 26.

This event will follow a similar format as the first show: technical
content in three tracks -- administration, development, and business
intelligence -- presented in this round by our roadshow training
partners Hitachi Consulting, Scalability Experts, and Solid Quality
Learning
. Keynoters for selected cities will include Bill Baker. As our
guest at the roadshow, you'll receive a special attendee bag, a "Get
Ready" logo shirt, and the SQL Server 2005 Upgrade Handbook.

Also, if you have a blog or an email communication that you send out,
we'd appreciate a mention of this terrific opportunity for SQL Server
professionals!

For more information about the show, visit the event Web site at
http://www.windowsitpro.com/roadshows/sqlserverusa/. Cities and dates
for the tour are as follows. We hope that one or more of these locations
will be convenient for you.

Portland, July 26, Hilton Portland & Executive Tower
Seattle, July 28, Sheraton Seattle Hotel & Towers
Kansas City, August 9, Sheraton Overland Park Hotel (at the Convention
Center)
St. Louis, August 11, Sheraton Westport Chalet Hotel St. Louis
Minneapolis, August 16, Hyatt Regency Minneapolis
Washington, DC, August 18, Wardman Park Marriott Hotel
Phoenix, August 23, Arizona Biltmore Resort & Spa
Denver, August 25, Denver Marriott Tech Center
Atlanta, August 30, Cobb Galleria
Tampa, September 1, Grand Hyatt Tampa Bay
Los Angeles, September 8, Los Angeles Marriott Downtown
Detroit, September 13, Hyatt Regency Dearborn
Philadelphia, September 15, Hilton Philadelphia City Center
Cincinnati, September 20, NKU/METS Center for Corporate Learning
Columbus, September 22, Greater Columbus Convention Center

Update: I'm hoping to attend the Los Angeles event. See you there!

Page 1 of 6 in the SqlAndXml category(RSS) Next Page