Today, we would be going through CrossTab queries using the PIVOT function available in SQL.
So let's start....and consider the below scenario
Below is the design of the table
Below is the data present in the table
Now, we want to
get data in the manner so that we can see how much money Employee has
spent on each travel medium. So, we would be making use of PIVOT here
select EmployeeName,[Train] as Train,[Bus] as Bus
from
(
select EmployeeName,TravelMedium,AmountSpent
from EmployeeExpenses) ee
PIVOT
(
SUM(AmountSpent)
FOR TravelMedium IN ([Train],[Bus])
) as pvt
Below is the result:
Hope so you got an overview of PIVOT with this.
Now, your turn....
Share with me how you are using PIVOT table in your project. In case of any questions, kindly leave your comment & I will try to get back to you.
Sunday, January 31, 2016
Thursday, January 21, 2016
Use Hardware keyboard with Windows Phone Emulator
I have just
started working with windows phone programming and i was thinking how we
can use hardware keyboard or desktop keyboard while working with
Windows phone Emulator.
So, today we would see how to enable / disable hardware keyboard with windows phone emulator
Enable Hardware Keyboard
Disable Hardware Keyboard
So, today we would see how to enable / disable hardware keyboard with windows phone emulator
Enable Hardware Keyboard
- Press PAGE UP key
Disable Hardware Keyboard
- Press PAGE DOWN Key
Hope this TIP would help you in working with windows phone emulator.
Sunday, January 17, 2016
Vibration in Windows Phone
While developing WINDOWS PHONE app, we often want phone to vibrate
like in case user has selected wrong option in quiz app OR time to
answer any question ends.
Following are the code snippets to be added in windows phone app making phone to vibrate:
1) Add following namespace
using Windows.Phone.Devices.Notification;
2) Below code needs to be added
VibrationDevice testVibrationDevice = VibrationDevice.GetDefault();
testVibrationDevice.Vibrate(TimeSpan.FromSeconds(2));
You can specify the time duration for which you want phone to vibrate.
In above code, I have given it 2 seconds. You can increase or decrease the time duration, according to you app scenario need.
Now your turn....
Add the above code in your app and let me know in case of any questions.
Until then HAPPY CODING !!
Following are the code snippets to be added in windows phone app making phone to vibrate:
1) Add following namespace
using Windows.Phone.Devices.Notification;
2) Below code needs to be added
VibrationDevice testVibrationDevice = VibrationDevice.GetDefault();
testVibrationDevice.Vibrate(TimeSpan.FromSeconds(2));
You can specify the time duration for which you want phone to vibrate.
In above code, I have given it 2 seconds. You can increase or decrease the time duration, according to you app scenario need.
Now your turn....
Add the above code in your app and let me know in case of any questions.
Until then HAPPY CODING !!
Subscribe to:
Posts (Atom)


