Thursday, October 8, 2009

how to shuffle records when querying from database

If we want to have records shuffled in a random manner then
you need to add the "ORDER BY NEWID()" as follows.

SELECT p.*,c.*
FROM dbo.tblPartnerInfo AS p
LEFT JOIN dbo.tblCountry AS c
ON p.CountryID=c.CountryID
WHERE p.CountryID=@CountryID
ORDER BY NEWID()

How to add multiple QueryString parameters to the ASP .NET SiteMapNode web.sitemap &

Only thing you have to do is index.aspx?Disclaimer=true&id=30

replace the "&" with "&". Otherwise you will get the following
error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The XML sitemap config file web.sitemap could not be loaded. An error occurred while parsing EntityName

Thursday, October 1, 2009

How to use alerts in asp.net without affecting the layout

If you want to add alerts in your asp.net c# application, don't use the method
using "Response.Write("your alert script");".Use the follownig method.Otherwise
you may lose your styles and layout may go mad.