Did you know that you can set multiple border styles for the sides of divs and images. By using the following css script, you can define any multiple borders you want:
By using this with another css trick, the border radius, you can set some nice effects when hovering images. The radius css is below (all three must be include to work in all browsers):
Do you have some more simple tricks? Let me know in the comments 😉 Happy CSSing!
It’s very common to show the current date (i.e., month, day, and year) in different formats. Although you can obtain the current date with Microsoft SQL Server’s GETDATE function, getting the returned date in the format you need can take a lot of effort and code. The FormatDate UDF (user-defined function) provides dates in various formats by using the following options: Continue reading
Today I needed to concatenate a field from multiple rows in SQL Server to get a list of people names. Instead of doing it in code, you can use the following syntax:
DECLARE @Names VARCHAR(8000)
SELECT @name = ”
SELECT @Names = @Names + ‘,’ + Names FROM People
SELECT SUBSTRING(2, @Names, 7998)
Last week, I restored a database from backup and was having the following error when trying to access the tables:
“The SELECT permission was denied on the object ‘extended_properties’, database ‘mssqlsystemresource’, schema ‘sys'”.
After some research, I found the next solution: Continue reading
To find the database creation dates, you need to insert the following query in SQL Server
SELECT name, crdate
Ever created a function and needed to include the Order By clause. It would result in the following error being loaded:
The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.
The problem is that to use, it requires a TOP clause or FOR XML. By if you specify TOP 100, you’ll only get the first 100 rows. You can specify a big number that you might think will never exceed. But what if you do? The best bet is to use TOP 100 PERCENT.
This will get you all the rows and works in Functions.
Cannot believe that I’m writing some helpful examples using VB.Net, but that is the language that we’re using at work, so have to adapt now. Next find how to make a loop with a negative step (decreasing step):
Public Class MainClass
Shared Sub Main()
For intCount As Integer = 10 To 1 Step -1
'Add the item to the list
The code below will add a column showing an incremental number near each row, which ultimately is the row number
<%# Container.DataItemIndex + 1 %>
Hope this helped 😉
During this weekend, I started having a problem when building a solution in Visual Studio. It would load the following error:
Unable to write to output file Solution_Name.pdb
This Visual Studio solution has 8 projects, and a lot of files and folders. I tried several solutions that I found on the net, which worked for others, but none worked for my case including:
- Delete the .pdb file from the solution – Didn’t Work
- Delete the Debug folder – Still Didn’t work
- Delete the whole obj Folder – Nothing Continue reading
This week, I needed to bind a gridview to and SQLDataSource. The only problem is that I need to include extra rows. How to do this? First I removed the binding code to bind the grid directly from HTML (in gridview remove the DataSourceID attribute).
Then I wanted to get the data from the SQL Data source and convert to a data table to insert and update the table as needed. Next is the code to get the data… Continue reading