We all reuse our windows controls out of the toolbox so why not our WPF user controls? The process is really the same. To show the steps involved let’s first write a simple WPF user control. After renaming the control and adding a WPF application project to my solution(to test with), my solution looks like this Since the functionality of the control is not important in this article, I just pasted in some animation code from msdn into my MyDemoControl.xaml file. <UserControl x:Class="MyDemoControl.MyDe...
Have you ever tried to implicitly cast a larger data type into a smaller type (as far as the number of bits) through a plain old assignment? c# wont let you do it! In this case the long’s value of 5 will definitely fit into an int but the compiler will still give you a no-no. Its avoiding possibly dropping some of the 64 bits when assigning the value to 32 bits. Not to worry, you can always do the explicit cast. int myInt; long myLong = 5; myInt = (int)myLong; This lets the compiler know that you...
SQL Server allows you to set a case sensitive collation at both the database and column level but often you will need to do a case sensitive search when everything is case insensitive. Not to worry, you can set the collation directly in the query. /* To test string equality including case when the DB is not case sensitive you must include collation as part of the test as follows: */ declare @mystring1 varchar(10) declare @mystring2 varchar(10) set @mystring1 ='abc' set @mystring2 ='ABC' -- by default...