DCSIMG
June 2009 - Posts - Shai Raiten

Shai Raiten

 Subscribe

June 2009 - Posts

Cannot open database "TfsWarehouse" requested by the login

Cannot open database "TfsWarehouse" requested by the login

I Installed TFS 2008 on Server 2008 with SQL 2008, everything during the installation went fine except the reports.

error

When I tried to process the cube using SSMS I got the following error:

Detailed Message: Cube processing runtime error: \r\nMicrosoft.AnalysisServices.OperationException: Internal error: The operation terminated unsuccessfully.Internal error: The operation terminated unsuccessfully.OLE DB error: OLE DB or ODBC error: Cannot open database "TfsWarehouse" requested by the login. The login failed.; 42000.Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'TfsWarehouseDataSource', Name of 'TfsWarehouseDataSource'.Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'Run', Name of 'Run' was being processed.Errors in the OLAP storage engine: An error occurred while the 'Run ID' attribute of the 'Run' dimension from the 'TfsWarehouse' database was being processed.

Solution:

1. SQL management Studio > Database Engine > Databases > TFSWarehouse> Security > Users

and make sure dbo user (administrator) has the tfswarehousedatareader schema checked.

image

2. Than execute the following script:

USE [TfsWarehouse]
GO
CREATE USER [NT AUTHORITY\NETWORK SERVICE] FOR LOGIN [NT AUTHORITY\NETWORK SERVICE]
GO
USE [TfsWarehouse]
GO
EXEC sp_addrolemember N'TfsWarehouseDataReader', N'NT AUTHORITY\NETWORK SERVICE'
GO

3. Restart SQL Service and the problem should be resolved.

Hope I can helped.

VSTS 2010 – Work Item Relations (Visual)

VSTS 2010 – Work Item Relations (Visual)

This is probably one of the biggest features coming in VSTS 2010 – Work Item Relations (Links).

In VSTS 2008 I wrote couple of custom control to manage the relations between work item Example: Work Item Relation - Custom Control, but VSTS 2010 gives as this feature.

Visual Relation is important and most in each development team, looking at work items and see the relations between those work items is a gift.

image

So looking at team system Queries you will see a flat view of work items, although you can see links between work items.

TFS2010-1

This is because you need to change the “Type of Query”.

Click “Edit Query”

TFS2010-2

And select “Work Item and Direct Links”

TFS2010-5

Direct Link allows you to map all links between work items and create the hierarchy.

You may notice that “Set up: Set Permissions” & “Set up: Migrate Source Code” appears twice.

This is because “Set up: Set Permissions” is the parent of “Set up: Migrate Source Code” and he is the child.

TFS2010-3 

There is a group of options allow you to filter the work items to show by:

TFS2010-6

And define the which relation to show.

TFS2010-7

TFS2010-8

Now change the “Type of Query” to "Tree of Work Items""

TFS2010-9

When setting “Type of Query” to Tree of Work Items you will see the full hierarchy between all work items.

TFS2010-10

How to set Work Item to be child or parent :

1. Right Click

    • <-- Outdent
    • --> Indent


TFS2010-11

2. Drag and Drop.

3. Right Click “Add New Linked Work item…”

image

Now you can select the desire “Link Type” for the new Work Items.

image

Enjoy

Working With Bluetooth Devices Using C# – Part 2 (OBEX)

Working With Bluetooth Devices Using C# – Part 2 (OBEX)

In my last post I talked about Working With Bluetooth Devices Using C# – Part 1

In this post I’ll show how to send file to bluetooth device.

To send file to a bluetooth device we need to use WebRequest but with obex format.

image

Download Demo Project

OBEX is an acronym that stands for OBject EXchange, mostly used in the communications technology field as a communications protocol. Because the Infrared Data Association maintains OBEX, it is also known as IrOBEX or Infrared OBEXMore About OBEX

First we have to find the device we want to send the file:

BluetoothClient bc = new BluetoothClient();

BluetoothDeviceInfo[] array = bc.DiscoverDevices();

int count = array.Length;

for (int i = 0; i < count; i++)

{

    Device device = new Device(array[i]);

    devices.Add(device);

}

 

and now using thread or background worker send the file using ObexWebRequest.

 

public class ObexWebRequest : WebRequest

    {

        public ObexWebRequest(Uri requestUri);

 

        public override long ContentLength { get; set; }

        public override string ContentType { get; set; }

        public override WebHeaderCollection Headers { get; set; }

        public override string Method { get; set; }

        public override IWebProxy Proxy { get; set; }

        public override Uri RequestUri { get; }

        public override int Timeout { get; set; }

 

        public override Stream GetRequestStream();

        public override WebResponse GetResponse();

        public void ReadFile(string fileName);

    }

And implement ObexWebResponse to get bluetooth device response.

Continue = 16,        Success = 32,        Created = 33,        Accepted = 34,        NonAuthorativeInformation = 35,        NoContent = 36,        ResetContent = 37,        PartialContent = 38,        MultipleChoices = 48,        MovedPermanently = 49,        MovedTemporarily = 50,        SeeOther = 51,        NotModified = 52,        UseProxy = 53,        BadRequest = 64,        Unauthorized = 65,        PaymentRequired = 66,        Forbidden = 67,        NotFound = 68,        BadMethod = 69,
        NotAcceptable = 70,        ProxyAuthenticationRequired = 71,        RequestTimeout = 72,        Conflict = 73,        Gone = 74,        LengthRequired = 75,        PreconditionFailed = 76,        RequestedEntityTooLarge = 77,        RequestedUrlTooLarge = 78,        UnsupportedMediaType = 79,        InternalServerError = 80,
        NotImplemented = 81,        BadGateway = 82,        ServiceUnavailable = 83,        GatewayTimeout = 84,        HttpVersionNotSupported = 85,        DatabaseFull = 96,        DatabaseLocked = 97,        Final = 128,

public class ObexWebResponse : WebResponse

    {

        public override long ContentLength { get; set; }

        public override string ContentType { get; set; }

        public override WebHeaderCollection Headers { get; }

        public ObexStatusCode StatusCode { get; }

 

        public override void Close();

        public override Stream GetResponseStream();

        public void WriteFile(string fileName);

    }

And this how it looks:

 

public static ObexStatusCode SendFile(BluetoothAddress address, string file_path)

{

    string FileName = file_path.Substring(file_path.LastIndexOf("\\"));

    Uri uri = new Uri("obex://" + address.ToString() + "/" + file_path);

 

    ObexWebRequest request = new ObexWebRequest(uri);

    request.ReadFile(file_path);

    ObexWebResponse response = (ObexWebResponse)request.GetResponse();

    response.Close();

 

    return response.StatusCode;

}

Download Demo Project

Working With Bluetooth Devices Using C# – Part 1

Working With Bluetooth Devices Using C# – Part 1

32feet.NET is a shared-source project to make personal area networking technologies such as Bluetooth, Infrared (IrDA) and more, easily accessible from .NET code.

Supports desktop, mobile or embedded systems. The project currently consists of the following libraries:-

  • Bluetooth
  • IrDA
  • Object Exchange

In this post I’ll show how to find Bluetooth devices using C# code.

MyPhone

Download Demo Project

First download 32Feet.net assemblies, the create new project and add those assemblies.

Add using for using InTheHand.Net.Sockets;

BluetoothClient bc = new BluetoothClient();

Use BluetoothClient to discover bluetooth devices:

public BluetoothDeviceInfo[] DiscoverDevices();

public BluetoothDeviceInfo[] DiscoverDevices(int maxDevices);

public BluetoothDeviceInfo[] DiscoverDevices(int maxDevices, bool authenticated, bool remembered, bool unknown);


*** DiscoverDevices takes about 20-30 seconds to complete.

List<Device> devices = new List<Device>();

BluetoothClient bc = new BluetoothClient();

BluetoothDeviceInfo[] array = bc.DiscoverDevices();

int count = array.Length;

for (int i = 0; i < count; i++)

{

    Device device = new Device(array[i]);

    devices.Add(device);

}

public class Device

{

    public string DeviceName { get; set; }

    public bool Authenticated { get; set; }

    public bool Connected { get; set; }

    public ushort Nap { get; set; }

    public uint Sap { get; set; }

    public DateTime LastSeen { get; set; }

    public DateTime LastUsed { get; set; }

    public bool Remembered { get; set; }

 

    public Device(BluetoothDeviceInfo device_info)

    {

        this.Authenticated = device_info.Authenticated;

        this.Connected = device_info.Connected;

        this.DeviceName = device_info.DeviceName;

        this.LastSeen = device_info.LastSeen;

        this.LastUsed = device_info.LastUsed;

        this.Nap = device_info.DeviceAddress.Nap;

        this.Sap = device_info.DeviceAddress.Sap;

        this.Remembered = device_info.Remembered;

    }

 

    public override string ToString()

    {

        return this.DeviceName;

    }

}

Download Demo Project

WCF Load Testing

WCF Load Testing

Thanks VSTS Rangers for the new release of “WCF Load Testing” tool that comes with ASMX support, you can find it here - http://wcfloadtest.codeplex.com/

Project Description:

This tool takes a WCF trace file and a WCF client proxy, or a WCF interface contract, and generates a unit test that replays the same sequence of calls found in the trace file. The code generated is easily modifiable so that data variation can be introduced for the purpose of doing performance testing.

Enjoy

How To: Fix error MSB3091 During MSBuild

How To: Fix error MSB3091 During MSBuild

Building Build Script for a customer I got the following error:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1756,9): error MSB3091: Task failed because "LC.exe" was not found, or the correct Microsoft Windows SDK is not installed…….

It seems like “LC.EXE” was not found and I need to install “Microsoft Windows SDK for Server 2008 and .NET Framework 3.5” (Running build on server 2003 machine).

LC.EXE” is the License Compiler comes with .NET Framework Tools so why the Build cannot find this file?

We can solve this small issue in couple ways:

1. You can try to reinstall Windows SDK or Install it - Link

2. Add the direction path to the registry:

Open “regedit” and goto HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A

Than add this key –> InstallationFolder=C:\Program Files\Microsoft SDKs\Windows\v6.0A\

Now Team Build have the right directions to Windows SDK files.

Hope this helps.

Ghotit Context Spell Checker – 4.2.2 Is Out & Free For Students

Ghotit Context Spell Checker – 4.2.2 Is Out & Free For Students

What is Ghotit?

Spelling is an integral part of the writing process.
Confidence in spelling often has a profound effect on a writer's self-image.
With Ghotit, you can write confidently, continuing to misspell as you always have, but with the confidence that Ghotit is there with you to review your writing and offer the right spelling text corrections.

FREE Assistive Technology for Schools, Universities, Educational Institutes
If you are an Educational Institute, you can offer Ghotit services and plug-ins FREE to all students

Download Page

Posted: Jun 09 2009, 10:34 PM by shair | with 2 comment(s)
תגים:,

HttpWebRequest and the Expect: 100-continue Header Problem

HttpWebRequest and the Expect: 100-continue Header Problem

Today I had an irritating problem when using the HttpWebRequest to POST form data over Proxy-Auth using HTTP 1.1.

When sending this request over SSL every thing was fine, but when I used POST I got this error - X-Squid-Error: ERR_INVALID_REQ 0 from the server.

After sniffing each request and drill down to understand the problem I found that not all web servers handle HTTP header "Expect: 100-Continue" correctly.

Who Add this Header? No me!

According to the HTTP 1.1 protocol, when this header is sent, the form data is not sent with the initial request.
Instead, this header is sent to the web server which responds with 100 (Continue).

Another drill down and I saw that method MakeRequest() inside System.Net.HttpWebRequest class contains the following code:

if (this._ExpectContinue && ((this._HttpWriteMode == HttpWriteMode.Chunked) || (this._ContentLength > ((long)0))))

   {

     this._HttpRequestHeaders.AddInternal("Expect", "100-continue");

   }

So even if I wanted to remove this header from the request header collection I CAN’T.

Getting back to HTTP 1.0 is not possible, and there is no method I can override.

Finally I’ve found - ServicePoint.Expect100Continue Property

When this property is set to true, client requests that use the POST method expect to receive a 100-Continue response from the server to indicate that the client should send the data to be posted. This mechanism allows clients to avoid sending large amounts of data over the network when the server, based on the request headers, intends to reject the request.

So just change Expect100Continue to false and back to work.

request.ServicePoint.Expect100Continue = false;

 
Hope I can help and save you time.

WHAT DOES SUCCESS MEAN TO YOU?

WHAT DOES SUCCESS MEAN TO YOU?

If you are using Team System and feels that you not getting what you want there is a new site called “Success with VSTS”  = to help people who are already working with Team System get more out of it:

nwLogoThe definition of success differs. Some clients tell us it is increased productivity, some say reduced costs, and some define success as optimization of their current spend.
Let us help you squeeze more VSTS success out of your existing tools.

Enter The Site

TeamSystemRocks – “Shai Raiten Posts”

TeamSystemRocks – “Shai Raiten Posts”

It’s nice to see a great VSTS site like TeamSystemRocks.com gives you a special area just for your posts and beside “Brain Harry”.

And Thanks to Noam Sheffer for taking a screenshot of blogs.microsoft.co.il while releasing my Visual Studio 2010 posts.

Thanks

imageUntitled