Tuesday, December 31, 2013

How to sort items of a list by name within his index?

I've order my items by name in a list but i have a problem selecting using the SelectedIndex the item is not the same as selected



for (int i = 0; i < storageList.GetFileNames().Length; i++)
{

filesbyname.Add(storageList.GetFileNames()[i]);
}
var byName = from name in filesbyname orderby name.ToString().ToLower() select name;
_LirycListBox.ItemsSource = byName;

private void _LirycListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (_LirycListBox.SelectedItem != null)
{
NavigationService.Navigate(new Uri(string.Format("/EditorSongLiryc.xaml?filename={0}", storageList.GetFileNames()[_LirycListBox.SelectedIndex]), UriKind.Relative));
}
}


How to sort items of a list by name within his index?


From : _LirycListBox.SelectedIndex
To : _LirycListBox.SelectedItem





jdweng


How to display Employee Attendance Data in Crosstab Format?

You can use a query like below



SELECT EmpID,
InDate,
MAX(CASE WHEN EntryType = 'In' THEN InTime END) AS InTime,
MAX(CASE WHEN EntryType = 'Out' THEN OutTime END) AS OutTime,
CAST(DATEDIFF(minute,MAX(CASE WHEN EntryType = 'In' THEN InTime END),MAX(CASE WHEN EntryType = 'Out' THEN OutTime END))/60 AS varchar(5)) + ':' + CAST(DATEDIFF(minute,MAX(CASE WHEN EntryType = 'In' THEN InTime END),MAX(CASE WHEN EntryType = 'Out' THEN OutTime END))%60 AS varchar(2)) AS TimeDIff
FROM table
GROUP BY EMpID,InDate







Then in reporting service use a matrix container


Add EmpID to row group and InDate to Column Group. Add other fields to detail portion to get report in your format.


see attached rdl for details


matrix report




Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs



How to display Employee Attendance Data in Crosstab Format?

Following page has an example for dynamic crosstab:


http://www.sqlusa.com/bestpractices2005/dynamicpivot/


You can also build an SSRS report with dynamic columns.




Kalman Toth Database & OLAP Architect IPAD SELECT Query Video Tutorial 3.5 Hours

New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012



Cannot open database

Cannot open database


hi,


I am getting this error message while running my problem.How can i get rid of it.



Error Message:Cannot open database "employeedata" requested by the login. The login failed.




amature.



Are you getting this error from application you are trying to connect ? .Can you try this login from SSMS check if it succeeds if not please post the error message you got.


What is your frond end application.What connection string you are using ?


Just check if below link is helpful


http://www.sqlservercentral.com/Forums/Topic1423758-391-1.aspx?Update=1




Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers


Hyperlink text to open in a browser question

I'm super new to programming for Windows, and I am having a crazy time trying to create simple hyperlinked text or buttons that will open a browser (whether internally or externally).


I have journeyed across the internet trying to figure it out, but just can't quite it figured out.


Here is an example of what I am working with:



<Paragraph>
<Hyperlink NavigateUri="http://vcc.mst.edu/Content_Repository/soc/summary/xdis/spring/">
<Run Text="Access Course"/>
</Hyperlink>
</Paragraph>

But for some reason unknown to me (a newb), it appears to be a link... it clicks like a link, but won't take any action when clicked upon. And after being clicked on multiple times, the app crashes.


Suggestions.


Sorry, this is probably really obvious.