about 7 months ago - No comments
Problem:
display label with the text full if the current field equal to zero in repeater or gridview
Solution:
<asp:Label ID=”Label1″ runat=”server” Text=”Full” ForeColor=”Red” Visible=’<%# Convert.ToBoolean(Eval(“name of your field”).ToString().Equals(“0″)? “true”:”false”) %>’>
about 8 months ago - No comments
problem:make some selection in database OTHER THEN top (10) post
solution: provide, table named news with element: newsID, newsDate
SELECT * FROM News WHERE (newsID NOT IN (SELECT TOP (10) newsID FROM News AS News_1 ORDER BY newsDate DESC)) ORDER BY newsDate DESC
it will return all post except top 10 post
about 11 months ago - No comments
problem:
display age with sql command
solution:
sql command:
SELECT DATEDIFF(mm, dateOfBirth, GETDATE()) / 12 AS age
FROM someTable
it wil display age ^^V
about 12 months ago - No comments
problem:
displaying list of bday boy/girl in next (30/ according to your own choice ) days from the current date.
solution:
im using the sql to select the date of birth, for displaying, you can use whatever you want, like gridview, datalist etc.
hereby the sql command:
SELECT DateOfBirth
FROM someTablename
WHERE (DateOfBirth < GETDATE()) AND (DATEDIFF(d, GETDATE(), DATEADD(yy, DATEDIFF(yy, DateOfBirth, GETDATE()), More >
about 1 year ago - No comments
SELECT previous row or "LIMIT-command" in MSSQL
SELECT TOP (1) FROM table_name WHERE (ID< @ID)
ORDER BY ID DESC
SELECT next row or "LIMIT-command" in MSSQL
SELECT TOP (1) FROM table_name WHERE (ID> @ID)
ORDER BY ID
Thank also for the descussion