Tuesday, March 04, 2008

The media set has 2 media families but only 1 are provided. All must be provided (Microsoft.SqlServer.SMO)

Microsoft SQL Server, Error: 3132

The media set has 2 media families but only 1 are provided. All must be provided (Microsoft.SqlServer.SMO)

Causes: While taking database backup from SQL server 2005, in the Back Up Database dialog window à Destination list box; if more then one path is available then SQL server creating back up in all available files and Media Sequence: Media 1, Family 2….n.

If 2 files path available then back created in 2 files, if 3 then back created in 3 files etc

In the above case .bak file would be created with Media Sequence: Media 1, Family 2. SQL server will create two database backup file in two (two file location mention in above destination box) locations.

And while restoring you must need all two files to restore database successfully.

If there are two paths in path selection box as shown in image above, the backup file is generated in two parts and saved at two different locations.

Here we have two backup files generated for selected database. Now at the time of restoring if you are assigning only one file and try to restore the database, you will get “SQL Server Error: The media set has 2 media families but only 1 are provided. All must be provided (Microsoft.SqlServer.SMO)” error.

Solution:

  1. While creating back up file make sure only one file available in the Back Up Database dialog box à Destination list box. SQL server will create complete database backup file in one location only.

Follow below procedure to take back up

1) Go to restore database

2) Select the database that you want to back up to

3) Locate the backup file on disk. You may have to put it into the MSSQL Server -> MSSQL.1-> MSSQL -> Backup Folder. It must be a .bak file.

4) Select the back that want to restore from the available backups.

5) Go to the top left "options" property and when you do that select "overrite existing database".

6) Now make sure that the paths to the files on database to be restored are correct in this same dialog view. Look at the paths to the database file and the log file and make damn sure that they are the correct ones for the database to be restored. The problem here is that those paths are going to be for the filesystem that the backup came from, not the one you are goning to put the restore onto. That's the big problem here.

  1. If you are aware about all destination files path then select all files path while resorting, add all the files (in above case two files) in destination list box.

And while restoring you must need all files to restore database successfully.

In short

1) You are trying to restore incomplete back up file or only 1 part of database back up file

2) You are trying to restore corrupt database backup file

3) You have not selected all database backup file path where all parts of back up files are present

Most of the situation you must not aware about all paths selected for back up, and you copy the back file from selected (from one location only) location (This is not complete back up files) and tried to restore that time you will get this error.

To avoid this situation make sure only one path available in the destination list box and copy back up file from available file path (This time you are coping complete database back up file) and while storing you will not get any such type error.

Monday, March 03, 2008

Window Workflow Foundation and New Feature of .NET 3.0

Window Workflow Foundation
Windows Workflow Foundation is a programming model, run-time engine, and tools for building workflow functionality into .NET applications. Fundamentally, a workflow is an arrangement of work units called activities. The concept of an activity is central to the workflow architecture.
There are two types of workflows:

1. Sequential: Its actions are executed in some predefined order with a beginning and an end. 2. State machines: These workflows don't have a path, but it's represented as a set of states and transitions between states.


Windows Workflow Foundation includes support for both system workflow and human workflow across a wide range of scenarios. WWF namespace in Microsoft .NET Framework version 3.0 and 3.5 is called System.Workflow. Windows Workflow Foundation provides a consistent and familiar development experience with other Microsoft .NET Framework version 3.0 and 3.5 technologies such as ASP.NET, Windows Communication Foundation (WCF) and Windows Presentation Foundation (WPF). WWF provides full support for VB.NET and C#, debugging, a graphical workflow designer and the ability to develop your workflow completely in code.

Windows Workflow Foundation also provides an extensible model and designer to build custom activities which encapsulate workflow functionality for end-users or for re-use across multiple projects. A workflow is a set of activities stored as a model that describe a real world process. Work passes through the model from start to finish and activities might be executed by people or by system functions. Activity receives some parameters from the developer, executes it actions, and then transfers the flow to the next activity. Developers can create new activities and use them in their own code or create an ActivityLibrary.

Workflow provides a way of describing the order of execution and dependent relationships between pieces of short or long running work. While it is possible to write a workflow completely in code, workflow is often best viewed graphically. Once a workflow model is compiled it can be executed inside any Windows process including console apps, forms- based apps, Windows Services, ASP.NET web sites and web services.

Download .NET 3.0 Framework from here

Download WWF Extension from here

Download WWF sample code from here

New Features of .NET 3.0

The new framework contains following foundation technologies.


Windows Presentation Foundation (WPF)

This is the one of the most familiar foundation among the four, because it provides interfaces for developing GUI. This is entirely a new way of programming for GUI. Using this foundation class programs can be developed for Desktop, Web, and mobile platforms.

In .NET 3.0 the GUI is defined using a XML language called XAML (Extensible Application Markup Language) pronounced like Zammel, which defines the layout of controls and defines the data binding. In a way, it separates the code and layout of controls, similar to ASP.NET 2.0 web page technology.

A sample XAML definition for Window with a button is given below.
<Window x:Class="SampleCS.Window1"
xmlns="ttp://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x=
"http://schemas.microsoft.com/winfx/2006/xaml"
Title="SampleCS">
<StackPanel>
<Button>Click Me</Button>
</StackPanel>
</Window>

Windows Communication Foundation (WCF)

This is another foundation library used for designing and developing application with communication between applications as a main goal. The communication can happen between the processes of same computer or two different computers in local network or internet.
This foundation is designed in accordance with the principle of service oriented architecture. WCF implements many advanced web services standards, like WS-Addressing, WS-Reliability, and WS-Security. It is basically a service and clients can consume those services over network. The service and client can be hosted in different OS platforms.

Windows workflow foundation (WWF)

It is technology for defining, executing, and managing workflows. Workflow is like a process mapping and definition. The sample application which implements WWF is SharePoint portal.

Visual studio 2005, the developer can design, implement, and test WWF workflows.

Windows card space (WCS)

The new Windows card space technology, is step towards better way of authenticating people, previously it was done using a username and password mechanism with the help of services like Active directory, Passport, and Windows membership.

Using this new technology, any user can create and share his identity. Microsoft implemented this solution in such a way that it can easily integrate with solutions from other company. For example a PHP solution can integrate card space technology with less than 200 lines of code.

These foundations technologies are based on the .Net 2.0, and provide new interfaces for software development. From the name itself, it is understood each foundation technologies are designed to use with specific tasks.