Archive for the ‘C#’ Category

var event = e || window.event; var keyCode = event.which || event.keyCode; if (keyCode == 83) // && event.ctrlkey) { if (event.ctrlKey) { var bt = document.getElementById(‘ButtonSave’); // Do something… if (e && e.preventDefault) { // DOM default for Firefox, safari, Opera and NN e.preventDefault(); return false; } else { //window.event.returnValue = false; return false; [...]

WebRequest AND HttpWebRequest to get Image from Server

Linq JOIN

Posted: September 25, 2009 in ASP.NET, C#
Tags: , ,

//var o = from p in db.t1 // join p2 in db.t2 on new { f1 = p.c1, f2 = “n” } equals new { f1 = p2.c2, f2 = p2.c3 } into temp // from x in temp.DefaultIfEmpty() // select new { f1 = p.c1, f2 = x.c2, f3 = x.c3 }; //var q [...]

Regex for hour (Example 0-23.99)

Posted: September 15, 2009 in ASP.NET, C#
Tags: , , ,

Expression:  ^([0-1]?\d|2[0-3])([\.,]\d{1,2})?$ Regular Expression for 0-23.99

The only configuration step you need to perform is to make sure your database has the ENABLE_BROKER flag set. Use Northwind ALTER DATABASE Northwind SET ENABLE_BROKER Notifications work with SELECT queries and stored procedures. However, some restrictions exist for the SELECT syntax you can use. To properly support notifications, your command must adhere to the [...]