Saturday 17 August 2013

How to Use pivot function in sql server and in Lightswitch?

How to Use pivot function in sql server and then in Lightswitch?

In this post you will know that how can you use sql server pivot function in visual studio lightswitch. Mainly pivot function is used to convert rows into columns. Here is an example of school time table with respect to a particular staff. With this example I will try to explain this concept. We will insert data row wise and they represent as column wise. 
Steps:
1. Insert data row wise from lightswitch screen

 Sql Server Entries 


2.  Create a view that will show these entries as column wise

ALTER view [dbo].[vwTimeTable] as
select pvt.*
            from (
            select Day = Day,
            TimeID,StaffMa.TecID,
            StaffName = StaffMa.Name,
            Description= Remarks,
            [Time] = Convert(varchar(10), T1.StartTime) + '  to ' +Convert(Varchar(10), T1.EndTime)
 from tbTimeTable) P
pivot
(
Max(P.Time) for P.Day in ([Sunday],[Monday],[Tuseday],[Wednesday],[Thursday],[Friday],[Saturday])
)
as pvt

3. Out Put is like as 

Sunday 4 August 2013

TF31003 tfs Error in Visual Studio 2010 and Visual Studio 2012

TF31003 tfs Error in Visual Studio 2010 and Visual Studio 2012

I am working with the Visual Studio LightSwitch 2010 and 2012 htmlclient version. Suddenly I got an error while connecting to tfs. The error is like as

TF31003: Either you have not entered the necessary credentials or your user account does not have permission to connect to the Team Foundation Server at https://***.visualstudio.com/. Ask your server administrator to add the appropriate permissions to your account

Solution:

After a long search, I got a solution of this error. That there is some cookies problem with internet explorer. 

Open internet explorer and press buttons Ctrl + Shift + Delete



after deleting all the cookies try to connect the tfs. I am sure that this time you will connect to the tfs and no error will occur.

More search