Musings and ramblings on .Net, Steelers, and other Stuff.
Asp.Net MVC, Forms and Missing Values
Get link
Facebook
Twitter
Pinterest
Email
Other Apps
-
Remember, Asp.Net requires that you use the Name and not just ID on your form controls. If you don’t, they don’t come along for the ride to your controller.
There are numerous posts on the keyboard shortcuts in Windows 8. I’m not going to regurgitate those. Here are the common things you’ll want to do. Shut Your Computer Off, Network / Wi-Fi, Volume, Keyboard Press Windows+I which brings up the Settings bar (below left). Search, Change Application Settings, Manage Devices Windows+C which brings up the Charms bar (above right). Want to find a song or artist in Music, use The rest of the story If you want to read about other short-cuts and print a handy-dandy cheat sheet, visit the Windows Experience Blog . IE 10 Want to get the most out of IE10, then How-To Geek’s The Best Tips and Tricks for Getting the Most out of Internet Explorer 10 is exactly what you need. There’s also Internet Explorer 10 Shortcut Keys In Windows 8 which has some Windows 8 stuff also.
I was helping someone with some SQL stuff and needed to give them a function to calculate someone's age. Rooted around a bunch of places and finally just ended up re-writing it. So this is mostly to have it on hand. This function is needed because DateDiff doesn't check if they've had their birthday this year. CREATE FUNCTION CalculateAge ( @ Start smalldatetime , @ End smalldatetime ) RETURNS int AS BEGIN -- Declare the return variable here DECLARE @Age int SET @Age = DateDiff( year , @ Start , @ End ) IF DateAdd( year , @Age, @ Start ) > @ End SET @Age = @Age - 1 RETURN @Age END GO VB Version Public Function Age( ByVal value As Date , ByVal d As Date ) As Integer Age = DateDiff(DateInterval.Year, value, d) If value.AddYears(Age) > d Then Age = Age - 1 Return Age End Function Technorati Tags: SQL Server , Visual Basic , Age , Dates , DateDiff
Here's an updated way to find all characters in a column. Basically, I loop thru the ASCII readable characters and see if they are present in the column. I did skip A-Z and a-z. If you want it to include A-Z and a-z, just comment out the If statements at the bottom of the loop. DECLARE @ColumnName varchar(200) = 'Text' DECLARE @TableName varchar(200) = 'Rows' DECLARE @SchemaName varchar(200) = 'SourceData' DECLARE @Sql varchar(max) DECLARE @MaxLength int = 126 DECLARE @Iterator int = 32 CREATE TABLE #AllChars ( ColChar CHAR(1), Instances int ) WHILE @Iterator < @MaxLength BEGIN SET @Sql = 'INSERT INTO #AllChars (ColChar, Instances) SELECT CHAR(' + CAST(@Iterator as varchar) + '), COUNT(*) FROM ' + @SchemaName + '.' + @TableName + ' WHERE CHARINDEX(CHAR(' + CAST(@Iterator as varchar) + '), Text) > 0' EXEC (@Sql) SET @Iterator = @Iterator + 1 -- Skips A-Z IF @
Comments