Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts

Thursday, 4 July 2013

Upgrading / uninstalling SQL 2008r2

This has happened to me before - sometimes when you want to un-install SQL 2008 (including r2) to clean-up before upgrading or re-installing you get an error message saying something like

Warning 26003. Microsoft SQL Server 2008 R2 Setup
Support Files cannot be uninstalled because the
following products are installed:
SQL Server 2008 R2 Common Files
Microsoft SQL Server 2008 R2 RsFx Driver



 
But these items do not appear in the Control Panel | Add/Remove programs applet. So how do you uninstall them?
 
Here's how:
http://myitforum.com/cs2/blogs/jnelson/archive/2011/08/30/159139.aspx

Friday, 14 June 2013

JSON success!

<feeling smug/>

It's a simple thing I know, but here's a screenshot from my Android phone. I have written a web service that wraps the Project Sputnik Assets Business Layer and sends JSON data. The screen shot shows the data in my SQL database on my phone. I just need to put an Android UI together now that can consume the service and render it in a user friendly way!
 

Monday, 20 May 2013

Progress update

Work commitments have hampered my work on Project Sputnik recently but I am happy to say that I have made progress.

I've created the official solution and added the child projects. I have created the DAL interface class, Entity classes and DAL classes for each table in the database, created the BL layer for the Assets that enforces the BL for the two asset classes, and finally thrown a WinForms thick-client test-harness together to display the items in the DB. This isn't demo or POC code but production code.

I'll post again soon with details and screen shots.

Tuesday, 14 May 2013

Connection Strings


Referring back to my initial attempt to port the existing VB6 application from MS Access to SQL Server by changing the connection string, one of the aims of Project Sputnik is to try to make it DB independent. Before my recent trip abroad my techie nerd/guru friend and former colleague put me on to a method which I believe will help me achieve this. The application will have a separate configuration file for the connection string (than App.Config) and the DAL will have a class that reads the connection string from this file. By writing ANSI compliant SQL in the DAL concrete classes I hope to achieve the goal to be DB impartial.

The App.Config file in the recent DAL Test Harness looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
       <connectionStrings configSource="connectionstrings.config" />
</configuration>

I added a configuration file called ConnectionStrings.Config and set the file property ‘Copy to Output Directory’ to ‘Copy Always’. The content of the file looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<connectionStrings>
       <add name="sql" connectionString="Server=<server>;Database=OfficeManager;User Id=<uid>;Password=<pwd>;" providerName="System.Data.SqlClient"/>
</connectionStrings>

The User ID and password have been hidden of course… The DAL has an additional class called AppSettingsReader.cs which looks like this:
using System;
using System.Configuration;

namespace DAL
{
    sealed class AppSettingsReader
    {
        public static ConnectionStringSettings GetConnectionSettings(String key)
        {
            return ConfigurationManager.ConnectionStrings[key];
        }
    }
}

For this to work there needs to be a reference to System.configuration in the project.

Saturday, 27 April 2013

Development Environment

So this afternoon I've put together the Dev Env for Project Sputnik. I have built a Virtual PC comprising Windows Server 2008, SQL Server 2008, IIS7 and Visual Studio Pro from my MSDN subscription, plus some of the usual extras that you need.

I think I'm ready to go...

Wednesday, 24 April 2013

Mike's Knowledgebase

I found this post REALLY helpful and worth a couple of hours working through the tutorials. It takes you through the process of setting up a WCF web service with a JSON payload to perform CRUD operations against SQL Server, and ultimately consume the service(s) in iOS.

http://mikesknowledgebase.com/pages/Services/WebServices.htm

Tuesday, 23 April 2013

Step 1

The current application is single user and was originally a VB6 application, so it makes sense that it uses a Microsoft Access database.
 
Not very 21st century though, huh?
 
The new version absolutely must use Microsoft SQL Server - there's no doubt in my mind about it, so to keep costs down I propose using SQL Express 2008 R2 to develop against.
 
Step 1 will be to download and install SQL Express, create a database with the same (or similar) data structure as the current database, and finally get some data into it.
 
The way I see it is that the starting point should be to port the existing application to use SQL Express rather than Access with no (obvious, or as little as possible) functional changes to the application resulting in a working product on SQL Express with the existing data. As time ticks by and the project progresses I will still need to use the existing application to run my business, and so the data will grow and change and I do not want to have any porting issues come switch-over day.
 
Anyway that's my rationale. So lets begin!

I downloaded SQL Express 2008 R2 With Tools from Microsoft and followed the installation procedure giving a named instance of SQLExpress and selecting Mixed Mode for authentication. Once that was done I fired up Management Studio and logged in to check things out.

So far so good.

Next was to port over the existing database from Microsoft Access. To do this I opened the existing database in Access and used the Uplift Wizard

 

 
I entered the settings for the new SQL Express installation and the new database name ...


... selected ALL tables ...


... accepted the default options ...


... selected "No application changes." as I want to manage the code changes myself when porting the current application to SQL Express ...


... and on the final step clicked Finish. The wizard threw up a few progress dialogues but nothing scary and in the end I was presented with an uplift report in Access.

I closed access and then used Management Studio to check the new database. It's all there! Excellent.

Step 1 is complete as I have a populated SQL database that I can use. On to step 2.

Project Inception

Boredom. That is how it started. I was sitting at my PC when I realised that I didn't have anything to do, so my mind turned to my Office Manager tool. I put my thoughts on Facebook: