Saturday, March 17, 2018

ObjectSpace

BaseObjectSpace Members

A base class for the classes that implement the IObjectSpace interface.

Expanded Public Constructors

Show: Inherited
 NameDescription
Public methodBaseObjectSpaceCreates a new instance of the BaseObjectSpace class.
Top

Expanded Public Properties

Show: Inherited
 NameDescription
Public propertyCanFilterByNonPersistentMembersFor internal use.
Public propertyConnectionGets the connection to the underlying data source.
Public propertyDatabaseGets the name of the database.
Public propertyIsCommittingIndicates whether the Object Space is currently committing the changes made to its object(s).
Public propertyIsConnectedIndicates whether the BaseObjectSpace is connected to the database.
Public propertyIsDeletingIndicates whether the current Object Space is about to delete an object(s).
Public propertyIsDisposedGets a value indicating whether an Object Space has been disposed of.
Public propertyIsModifiedSpecifies whether objects belonging to the current Object Space are modified.
Public propertyIsReloadingGets a boolean value indicating whether or not the Object Space is reloading.
Public propertyLockingCheckEnabledSpecifies whether or not the additional locking check is performed.
Public propertyModifiedObjectsReturns a collection of objects that have been created, modified or deleted in the current object context.
Public propertyNonPersistentChangesEnabledSpecifies whether the BaseObjectSpace is marked as modified (see IsModified) when a non-persistent property is changed.
Public propertyOwnerSpecifies the View owning the current Object Space.
Public propertyTypesInfoGets information on the business classes added to the Application Model (see IModelBOModel).
Top

Expanded Public Methods

Show: Inherited
 NameDescription
Public methodApplyCriteriaFilters a particular collection on the server side.
Public methodApplyFilterFilters a particular collection on the client side.
Public methodCanApplyCriteriaIndicates whether collections of a particular type can be filtered on the server side.
Public methodCanApplyFilterIndicates whether a particular collection can be filtered on the client side.
Public methodCanInstantiateIndicates whether instances of a particular type can be created.
Public methodCommitChangesSaves all the changes made to the persistent objects belonging to the current Object Space to the database.
Public methodContainsIndicates whether a specified object belongs to the current Object Space.
Public methodStatic memberConvertExpressionsStringToExpressionsListReturns the list of DataViewExpression objects converted from the passed semicolon-separated expressions list.
Public methodStatic memberConvertSortingToStringReturns the string representation of a given sort list.
Public methodStatic memberConvertStringToSortingConverts the sorting string into the sorting list.
Public methodCreateCollectionOverloaded. Creates and initializes a collection of objects of the specified type.
Public methodCreateDataViewOverloaded. Returns a list of data records retrieved from a database without loading complete business classes (a data view). Values in each data record can be obtained from specific business class properties directly, or be evaluated by the database server using complex expressions.
Public methodCreateInstantFeedbackCollection
Public methodCreateNestedObjectSpaceCreates a nested Object Space.
Public methodCreateObjectCreates an object of the specified type.
Public methodCreateObjectCreates an object of the type designated by the specified generic type parameter.
Public methodCreateParseCriteriaScopeUsed when parsing a CriteriaOperator represented by a string and containing persistent objects.
Public methodCreateServerCollectionCreates and initializes a new instance of the EFServerCollection or DevExpress.Xpo.XPServerCollectionSource class with criteria-specific options.
Public methodDeleteOverloaded. Marks the specified persistent object and its aggregated objects as deleted from persistent storage.
Public methodDisposeReleases all resources used by an BaseObjectSpace object.
Public methodEnableObjectDeletionOnRemoveEnables/disables the deletion of persistent objects from the data source when they are removed from the specified collection.
Public methodStatic memberEqualsDetermines whether the specified System.Object instances are considered equal. (Inherited from System.Object)
Public methodEqualsDetermines whether the specified System.Object is equal to the current System.Object. (Inherited from System.Object)
Public methodEvaluateEvaluates the specified criteria for business objects of the given type.
Public methodFindObjectOverloaded. Searches for the first object of the specified type, matching the specified criteria.
Public methodFindObjectOverloaded. Searches for the first object of the type designated by the specified generic type parameter, matching the specified criteria.
Public methodGetAssociatedCollectionCriteriaReturns the criteria applied to a specific object's associated collection property.
Public methodGetCollectionObjectType
Public methodGetCollectionSortingReturns the sort settings for a particular collection.
Public methodGetCriteriaReturns the criteria used to filter a particular collection on the server side.
Public methodGetDisplayablePropertiesGets the properties considered visible by the specified collection.
Public methodGetEvaluatorContextDescriptorCreates an instance of the EvaluatorContextDescriptor that is used to supply metadata on the specified type to the ExpressionEvaluator objects.
Public methodGetExpressionEvaluatorOverloaded. Creates an ExpressionEvaluator object that is used to evaluate whether objects of the specified type satisfy a particular criteria.
Public methodGetFilterReturns the criteria used to filter a particular collection on the client side.
Public methodGetHashCodeServes as a hash function for a particular type. System.Object.GetHashCode is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from System.Object)
Public methodGetIntermediateObjectReferencesFor internal use.
Public methodGetKeyPropertyNameGets the name of the specified type's key property.
Public methodGetKeyPropertyTypeGets the key property type of the specified business type.
Public methodGetKeyValueOverloaded. Returns the key property's value of the specified object.
Public methodStatic memberGetKeyValueOverloaded. Returns the key property's value of the specified persistent object.
Public methodGetKeyValueAsStringOverloaded. Returns the key property's value of the specified object, converted to a string representation.
Public methodStatic memberGetKeyValueAsStringOverloaded.
Public methodGetObjectRetrieves an object that corresponds to a specific object from another Object Space or to a specific record from a data view created by the IObjectSpace.CreateDataView method.
Public methodGetObjectRetrieves an object from another Object Space to the current Object Space. The returned object is cast by the type designated by the specified generic type parameter.
Public methodGetObjectByHandleReturns the object with the specified handle.
Public methodGetObjectByKeyReturns the persistent object that has the specified value for its key property.
Public methodGetObjectByKeyReturns a persistent object of the type designated by the specified generic type parameter, with the specified value for its key property.
Public methodGetObjectHandleReturns an object's handle.
Public methodGetObjectKeyConverts the key property value string representation into its actual type.
Public methodGetObjectsOverloaded. Returns an IList collection of objects of the specified type, retrieved to the current Object Space and filtered according to the specified criteria.
Public methodGetObjectsOverloaded. Returns an IList collection of objects of the specified type, retrieved to the current Object Space and filtered according to the specified criteria.
Public methodGetObjectsCountReturns the number of objects specified.
Public methodGetObjectsCriteriaConstructs a criteria that can be used to select the specified list of business objects.
Public methodGetObjectsQueryGets a queryable data structure that provides functionality to evaluate queries against a specific business object type.
Public methodGetObjectsToDeleteReturns a collection of persistent objects that will be deleted when the current transaction is committed, including objects that will be deleted in the parent transaction(s), optionally.
Public methodGetObjectsToSaveReturns a collection of persistent objects that will be saved when the current transaction is committed, including objects that will be saved in the parent transaction(s), optionally.
Public methodGetObjectTypeReturns the type of the specified business object.
Public methodGetTopReturnedObjectsCountReturns the maximum number of objects to be retrieved by the specified collection from a data store.
Public methodGetTypeGets the System.Type of the current instance. (Inherited from System.Object)
Public methodIsCollectionLoadedIndicates whether a particular collection is loaded with objects from the database.
Public methodIsDeletedObjectIndicates whether the specified persistent object is deleted from the database.
Public methodIsDeletionDeferredTypeReturns a value that indicates if the deferred deletion is enabled for persistent objects of a given type.
Public methodIsDisposedObjectDetermines whether an object has been disposed of.
Public methodIsIntermediateObjectFor internal use.
Public methodIsKnownTypeReturns the boolean value indicating whether or not the specified type is known by the BaseObjectSpace.
Public methodIsNewObjectIndicates whether a specified object has been created but has not been saved to the database.
Public methodIsObjectDeletionOnRemoveEnabledIndicates whether the deletion of persistent objects from the data source when they are removed from the specified collection is enabled.
Public methodIsObjectFitForCriteriaOverloaded. Specifies whether a particular object satisfies the specified criteria.
Public methodIsObjectToDeleteIndicates whether the specified object has been deleted but not committed in the current object context or the transaction currently in progress.
Public methodIsObjectToSaveIndicates whether the specified object has been added, deleted or modified, but not committed in the current object context or the transaction currently in progress.
Public methodStatic memberObjectKeyValuesEqual
Public methodParseCriteriaTries to convert the specified string representation of an expression to its DevExpress.Data.Filtering.CriteriaOperator equivalent.
Public methodStatic memberReferenceEqualsDetermines whether the specified System.Object instances are the same instance. (Inherited from System.Object)
Public methodRefreshUpdates the persistent objects belonging to the current Object Space.
Public methodReloadCollectionClears the specified collection.
Public methodReloadObjectUpdates the specified object in the current Object Space with data from the data source.
Public methodRemoveFromModifiedObjectsRemoves the specified object from the object context or the list of objects to be committed.
Public methodRollbackCancels the changes made to the persistent objects belonging to the current Object Space.
Public methodSetCollectionSortingApplies the specified sorting to a given collection.
Public methodSetDisplayablePropertiesChanges the properties considered visible by a particular collection.
Public methodSetModifiedOverloaded. Sets the state of the specified object to be Modified.
Public methodSetPrefetchPropertyNames
Public methodSetTopReturnedObjectsCountSets the maximum number of objects that can be retrieved from the specified collection in a data store.
Public methodToStringReturns a System.String that represents the current System.Object. (Inherited from System.Object)
Top

Expanded Public Fields

Show: Inherited
 NameDescription
Public fieldStatic memberCompositeKeyPropertyType
Top

Expanded Public Events

Show: Inherited
 NameDescription
Public eventCommittedRaised after saving changes made to persistent objects belonging to the current Object Space to the database.
Public eventCommittingOccurs before saving the persistent objects belonging to the current Object Space to the database.
Public eventConfirmationRequiredOccurs when performing refresh or rollback operations with the current Object Space's persistent objects.
Public eventConnectedOccurs after a connection to a database has been established.
Public eventCustomCommitChangesReplaces the default process for committing changes made to persistent objects with a custom one.
Public eventCustomDeleteObjectsOccurs to replace the default process of deleting persistent objects with a custom one.
Public eventCustomRefreshOccurs to replace the default process of refreshing persistent objects with a custom one.
Public eventCustomRollBackOccurs to replace the default process of persistent objects rollback with a custom one.
Public eventDisposedOccurs before an Object Space is disposed of.
Public eventModifiedChangedOccurs when the current Object Space's IsModified state is changed.
Public eventObjectChangedRaised when a persistent object is created, changed or deleted.
Public eventObjectDeletedOccurs after the specified objects have been deleted.
Public eventObjectDeletingOccurs when the specified objects are about to be deleted.
Public eventObjectEndEditOccurs after ending an edit operation taking place on the specified object.
Public eventObjectReloadedOccurs after an object has been reloaded from the database.
Public eventObjectSavedOccurs after saving changes made to a specified persistent object to the database.
Public eventObjectSavingRaised before saving changes made to a specified persistent object to the database.
Public eventRefreshingOccurs before refreshing the current Object Space's persistent objects.
Public eventReloadedOccurs when the Rollback or Refresh method is called.
Public eventRollingBackOccurs before rolling back the changes made to the current Object Space's persistent objects.
Top

Expanded See Also

Pop-up Window

Add an Action that Displays a Pop-up Window

In this lesson, you will learn how to create an Action that shows a pop-up window. This type of Action is useful when you want a user to input several parameters in a pop-up dialog before an Action is executed.
Note
Before proceeding, take a moment to review the following lessons.

Expanded Create a Controller and a PopupWindowShowAction

  • Add a new View Controller to the MySolution.Module project, as described in the Add a Simple Action lesson. Name it PopupNotesController.
  • Right-click the MySolution.Module | Controllers | PopupNotesController.cs (PopupNotesController.vb) file, and choose View Designer to invoke the Designer.
  • Drag the PopupWindowShowAction component from the DX.17.2: XAF Actions tab to the Designer. In the popupWindowShowAction1 "Properties" window, set the Name and Id properties to "ShowNotesAction", and set the Caption property to "Show Notes". Set the Category property to "Edit". This property specifies the Action group to which the current Action belongs. All Actions within a single group are displayed together sequentially in a UI.
  • To activate the PopupNotesController for DemoTask Detail Views only, set the Controller's ViewController.TargetObjectType property to MySolution.Module.DemoTask, and set the ViewController.TargetViewType to DetailView.

Expanded Specify the Popup List View

Focus the ShowNotesAction component. In the Properties window, switch to the Events view. Double-click the CustomizePopupWindowParams event, add the "using" ("Imports" in VB) directive according to your ORM, and replace the auto-generated event handler code with the following code.
C#
VB
using DevExpress.Persistent.BaseImpl; //For XPO 
using DevExpress.Persistent.BaseImpl.EF; //For EF 
// ... 
private void ShowNotesAction_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs args) {
    IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(Note));
    string noteListViewId = Application.FindLookupListViewId(typeof(Note));
    CollectionSourceBase collectionSource = Application.CreateCollectionSource(objectSpace, typeof(Note), noteListViewId);
    args.View = Application.CreateListView(noteListViewId, collectionSource, true);
    //Optionally customize the window display settings. 
    //args.Size = new System.Drawing.Size(600, 400); 
    //args.Maximized = true; 
    //args.IsSizeable = false; 
}
For details on this event, refer to the PopupWindowShowAction.CustomizePopupWindowParams topic. The code above will create the Notes List View when generating the pop-up window.
To create a List View, use the XafApplication object again (as you did in the previous lesson). In the code above, the XafApplication helps you find the ID of the required List View in the Application Model. Note that a collection source for the List View is created in a separate Object Space. To create the Object Space, use XafApplication again.

Expanded Handle the Execute Event

In the Controller's Designer, switch to the Events view in the Properties window with the Action's properties. Double-click the Execute event, add the "using" ("Imports" in VB) directive and replace the auto-generated event handler code with the following code.
C#
VB
using MySolution.Module.BusinessObjects;
// ... 
private void ShowNotesAction_Execute(object sender, PopupWindowShowActionExecuteEventArgs args) {
    DemoTask task = (DemoTask)View.CurrentObject;
    foreach(Note note in args.PopupWindowViewSelectedObjects) {
        if(!string.IsNullOrEmpty(task.Description)) {
            task.Description += Environment.NewLine;
        }
        task.Description += note.Text;
    }
    if(((DetailView)View).ViewEditMode == ViewEditMode.View) {
        View.ObjectSpace.CommitChanges();
    }
}
The Execute event is raised when clicking the OK button in the pop-up window. When the handler above is executed, the Text property value of the selected Note object will be appended to the Task.Description property value.
In this code, access the object selected in the pop-up window by using the event handler's PopupWindowShowActionExecuteEventArgs.PopupWindowViewSelectedObjects parameter.
To refresh the editor representing the modified Description property, first find its PropertyEditor in the current View's CompositeView.Items collection using the CompositeView.FindItem method. To update the value displayed by the Property Editor's editor, call the PropertyEditor.ReadValue method.
In ASP.NET Web applications, Detail Views are displayed in View and Edit modes. When the ShowNotes Action is activated for a DemoTask Detail View that is in View mode, the changes made to the DemoTask.Description property should be saved to the database. For this purpose, the CommitChanges method of the current View's ObjectSpace is called. When you use the ShowNotes Action in a DemoTask Detail View that is in Edit mode, the changes can be saved or rolled back via the corresponding built-in Actions.

Expanded Add Notes to the UI

  • To add the Note business class to the UI construction process, add it to the Application Model.
  • If your ORM is Entity Framework, you should register the Note type in DbContext before proceeding to the next step. Edit the BusinessObjects\MySolutionDbContext.cs file as shown below.
    C#
    VB
    public class MySolutionDbContext : DbContext {
        //... 
        public DbSet Notes { get; set; } 
    }
    
  • To add the Note business class from the Business Class Library use the Module Designer. Double-click the Module.cs (Module.vb) file within the MySolution.Module project. The Exported Types section of the designer lists the business classes that can be added.
    • If you are using XPO:
      Locate the Referenced Assemblies | DevExpress.Persistent.BaseImpl.v17.2 | Note node.
    • If you are using Entity Framework:
      Locate the Referenced Assemblies | DevExpress.Persistent.BaseImpl.EF.v17.2 | Note node.
    Select this node and press the SPACEBAR, or right-click it and choose Use Type in Application in the invoked context menu.
  • Build the project.
  • Note
    To create Note objects, you should add the Note item to the New Action's items. To do this, perform the steps demonstrated in the Add an Item to the New Action lesson.
    To access the existing Note objects, add the Note item to the ShowNavigationItem Action's items (displayed by the navigation control). To do this, perform the steps demonstrated in the Add an Item to the Navigation Controllesson.

Expanded Result

Run the WinForms or ASP.NET application. Create several Note objects via the New Action. Select the Task item in the navigation control. Double-click one of the listed Task objects. In the invoked detail form, find the Show Notes toolbar button that represents the implemented Action. Click this button, which will invoke a pop-up window. Select a Note object in the list and click OK. Check to see that the Task.Description property value has been changed.
Tip
For an example of how to create and show a Detail View, refer to the How to: Create and Show a Detail View of the Selected Object in a Popup Window topic.
You can view the code demonstrated in this tutorial in the MySolution.Module | Controllers | PopupNotesController.cs (PopupNotesController.vb) file of the Main Demo installed with XAF. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 17.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/MainDemo/.

Next Lesson: Add an Action with Option Selection

Expanded See Also

Thursday, November 10, 2011

Resource on ReportingService

MS SQL 2008 R2 SP1 download:
http://msftrsprodsamples.codeplex.com/releases/view/72275

Good Reporting service product sample:
http://msftrsprodsamples.codeplex.com/

msdn reporting service resource:
http://msdn.microsoft.com/en-us/sqlserver/cc511478.aspx

technet
http://technet.microsoft.com/en-us/ff657833.aspx

Thursday, January 20, 2011

Three myths of enterprise wiki deployment

Three myths of enterprise wiki deployment


By Kathleen Lau | Feb 2, 2009
A Denmark-based analyst with research firm J. Boye said she's encountered an organization that, after implementing an enterprise-wide employee wiki, realized it didn't exactly have the right culture to bring it to life.
Discussions prior to the site launch debated whether employees should contribute anonymously or through profiles, and whether those profiles should include user photos, recounted Dorthe Jespersen. Ultimately, employees were allowed to contribute through profiles with pictures, she said, "but [the organization] had a conservative culture so no one actually wanted to make visible what they were working on right now."
Jespersen said the employees' concerns varied anywhere from harbouring concerns around writing about work that perhaps wouldn't be considered "real" work, or about work that they weren't supposed to be doing at the time, or even having fears of making spelling errors.
"Even small things, as how you decide to set up the design... that can actually have an effect on adoption," she said.
With the growing popularity of enterprise 2.0, many organizations are increasingly willing to grant employees a common platform upon which to collaborate and contribute and share ideas. Wikis are often touted as such a platform that is easily launched and to which employees will flock to contribute ideas, but Jespersen said they can prove difficult to get off the ground if not done properly.
One issue is the hype surrounding wikis or the blind faith with which they are approached, said Jespersen. "People often look to Wikipedia as a free form where everyone is contributing, and why could we not do the same with our organization?," she said, having observed wikis entering the scene to compensate for an intranet that has fallen to the wayside. But, she said, technology alone won't resolve that issue.
Jespersen lists three myths surrounding wiki implementation that might make some organizations rethink the expectations they've built around their platform:
Myth One: Wikis will motivate employees to contribute content.
It won't happen automatically that employees will freely contribute. Jespersen describes the "Empty wiki syndrome," or when a wiki is deployed without a clear purpose or is too general in its focus, resulting in a site with almost no activity.
It helps, said Jespersen, to appoint someone to manage the wiki, ensure there is structure like guidelines and a basic information architecture, and that it is launched with content already posted because "it's very hard to just react to this empty space for the user."
And, as Jespersen described, a conservative corporate culture that is not based in collaboration to begin with, will have to ensure its expectations are realistic when launching a wiki. If employees are expected to use the platform to critique each others work -- as they would normally do through e-mail chains and back-and-forths -- it can be a hurdle to openly critique content, she said.
Highly-successful wikis are often driven by IT-savvy employees, noted Jespersen, given the familiarity with technology and previous experience with wikis. But in general, those tasked with driving the project will be determined by the scope of the wiki, which could be either enterprise-wide or group level. The former, she said, will require a person like an intranet manager, whereas the latter can be managed by a member of each group.
Myth Two: Employees know how to contribute.
The concept of a wiki may be simple, but contributing content is not necessarily logical for casual users. Jespersen said some organizations prefer to refer to existing written policies around content creation that say, for instance, employees are responsible for the content they produce. But policies can be tricky considering the goal is to strike a balance between governance and structure and flexibility, said Jespersen, "but it's difficult not to fall into either extreme."
Some wiki-specific policies can include guidelines around creating pages that are easy to read by having a table of contents if the page is long, or having a naming system for links to ensure consistency.
Myth Three: Wikis will always provide the information employees need.
Although searchability is often a selling point of wikis, Jespersen said the reality is wikis are difficult to search through, unlike a content management system. Given there is little structure built into wikis, "it is difficult to structure this information to make it findable the next day even."
Content on a wiki can grow faster than the organization can keep up, she said, therefore the wiki managers must perform regular searches and quality checks of the content.
Overall, Jespersen suggested starting with a pilot so that the true purpose and scope of the wiki can be first ascertained before an enterprise-wide launch.

Tuesday, June 8, 2010

How to: Disable all the external data connections included in a workbook in Excel 2007.

How to: Disable all the external data connections included in a workbook in Excel 2007.

How to: Disable all the external data connections included in a workbook in Excel 2007.

Solution Open the Microsoft Excel workbook. Click the 'Microsoft Office' button. Click the 'Excel Options' button. In the left pane, click 'Trust Center'. In the 'Microsoft Office Excel Trust Center' section, click the 'Trust Center Settings' button. In the left pane, click 'External Content'. In the 'Security settings for Data Connections' section, select the 'Disable all Data Connections' check box. Click 'OK'. Click 'OK'.

Details

Microsoft Excel 2007 is configured to protect worksheet elements from external threat such as viruses. If the worksheet is not protected properly, the malicious content can corrupt or damage the worksheet data. To protect the worksheet against external threats, you must disable all the external data connections included in a workbook.

To disable all the external data connections included in a workbook:

1) Open the Microsoft Excel workbook.
2) Click the 'Microsoft Office' button.
3) Click the 'Excel Options' button. (The 'Excel Options' dialog box appears.)
Screen: 'Excel Options' dialog box
4) In the left pane, click 'Trust Center'. (The 'Trust Center' screen appears.)
Screen: 'Trust Center' screen
5) In the 'Microsoft Office Excel Trust Center' section, click the 'Trust Center Settings' button. (The 'Trust Center' dialog box appears.)
Screen: 'Trust Center' dialog box
6) In the left pane, click 'External Content'. (The 'External Content' screen appears.)
Screen: 'External Content' screen
7) In the 'Security settings for Data Connections' section, select the 'Disable all Data Connections' check box.
8) Click 'OK'.
9) Click 'OK'.

Knowledge-Paks Online and Knowledge-Paks On Site Copyright (c) 2008 by RightAnswers, Inc. Subject to the terms set forth in the end-user license agreement. All rights reserved.

Details

Monday, May 31, 2010

restore ms sql 2008 db to ms sql 2005

How To Convert Database of SQL Server 2008 to SQL Server 2005?

Requirements

If you are trying to restore database backup of SQL Server 2008 to SQL Server 2005, you are bound to fail. Database backup of SQL Server 2008 is not compatible backward, you cannot restore it to SQL Server 2005. The following is a solution to convert databases of SQL Server 2008 to 2005

Step by Step Guide

1) Start convert wizard

Open SQL Server Management Studio2008. in 'Object Explorer', right click the database that you want to convert. Select 'Tasks' > 'Generate Scripts...'.

Change Hyper-V Default Folders Step 1

2) Next

Click 'Next'.

Change Hyper-V Default Folders Step 1

3) Select database and objects

Select the database that you want to convert, and check on 'Scripts all objects in the selected databases'

Change Hyper-V Default Folders Step 2

4) Convert Options

Set options:

'Script for Server Version' = 'SQL Server 2005' 'Script Data' = 'True' 'Scirpt Database Create' = 'True'     

Change Hyper-V Default Folders Step 2

5) Output Option

Select option 'Script to file', 'Single file' and 'Unicode text'.

Change Hyper-V Default Folders Step 1

6) 'Finish'

View summary and click 'Finish'.

Change Hyper-V Default Folders Step 1

7) Result

Now you got a complete database creation script with data. It can be executed on target database server.

Change Hyper-V Default Folders Step 1

8) Amend Script

Open the generated script in SQL Server Management Studio 2005. Find the following section and amend the path to proper data folder
    CREATE DATABASE [StockTraderDB] ON  PRIMARY  ( NAME = N'StockTraderDB',  FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\StockTraderDB.mdf ,  SIZE = 4352KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )  LOG ON  ( NAME = N'StockTraderDB_log',  FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\StockTraderDB_log.LDF',  SIZE = 6272KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) 

9) Execute the Script

When finished, You should get converted database of SQL Server 2005