Monthly Archives: May 2009

SELECT next, last row or “LIMIT-command” in MSSQL

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 … Continue reading

Posted in sql | Tagged | Leave a comment

weblog thomassmart com

A blog of a fellow programmer He is a php programmer

Posted in friend | Tagged | 1 Comment

disable remove viewstate aspx

Problem: Annoying LONG viewstate <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEyMjcx NDEzNzQPZBYCZg9kFgQCAQ9kFgICAg8VAh4vV29ybGRHcmFubnkvanMvZGRhY2NvcmRpb24u anMkL1dvcmxkR3Jhbm55L2pzL2pxdWVyeS0xLjIuMi5wYWNrLmpzZAIDD2QWBAIDDxYCHgtfIUl0 ZW1Db3VudAIKFhRmD2QWBAIBDw8WAh4LTmF2aWdhdGVVcmwFFH4vUGFnaW5hLzIvaG9tZS5h c3B4ZBYCZg8VAQRIb21lZAIDDxYCHwACARYCAgEPZBYCAgEPDxYCHwEFFX4vUGFnaW5hLzQvc3V iLTEuYXNweGQWAmYPFQEFc3ViIDFkAgEPZBYEAgEPDxYCHwEFG34vUGFnaW5hLzMvb3JnYW5pc2F0a WUuYXNweGQWAmYPFQELT3JnYW5pc2F0aWVkAgMPFgIfAAICFgQCAQ9kFgICAQ8PFgIfAQUUfi9QYWdpb mEvNS9zdWIyLmFzcHhkFgJmDxUBBHN1YjJkAgIPZBYCAgEPDxYCHwEFGH4vUGFnaW5hLzgvbmV3LXBhZ2" /> LOL.. long huh Solution: put this code in your .cs page //overwrite the  SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium protected override void SavePageStateToPersistenceMedium(object viewState)     { … Continue reading

Posted in asp.net | Tagged , , | Leave a comment

find value in repeater asp net

Problem: find value in repeater Solution: write this code in itemdatabound on your repeater: protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)     {         if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)         {             Label title = e.Item.FindControl("Label1") as Label; … Continue reading

Posted in asp.net | Tagged , , | Leave a comment