When using Webclient to retrieve some file from the web you can face problem with caching your files.
For example: You have a xml file with version number inside. After downloading first time by Webclient class, you changed content of the xml file and start process again. Unfortunately you will receive old content downloaded earlier instead newest content of the file.
That happens because of Microsoft Internet Explorer (as far as I know) Cache settings used by Webclient class.
So to disallow for caching your requests you have to change Weblicent CachePolicy property. You can do it as shown below:
string xmlUrl = "http://myserver.com/xmlfile.xml";
WebClient client = new WebClient();
// prevent file caching by windows
client.CachePolicy = new System.Net.Cache.RequestCachePolicy(
System.Net.Cache.RequestCacheLevel.NoCacheNoStore
);
// read content of file
Stream rssStream = client.OpenRead(xmlUrl);
Sometimes we need some application which allow us to send some messages, files to recipients automatically based on our settings. It is especially helpful if we set up low-cost scenario. For example: SQL Server Express (it means no SQL Agent and DTS export/import functionality, Database Mail module etc.)
From few freeware programs which I tested I would like to recommend you BEEE (Better Email Enable Everything). It is Free for commercial and personal use.

It is not longer supported by producent but it is still available for download from their webpage. Old doesn’t mean weak or poor functionality. This program is really brillant and works like a charm!
BEEE feature list:
- Easily email multiple files and/or entire folders
- Run multiple instances of BEEE at the same time
- Run BEEE in the background (from your system tray)
- Command line options allow for easy integration with most application software that can run executables (e. g. task schedulers)
- Build-in ZIP compression, encryption and password protection of the attachments !
- Email indirectly via MAPI enabled email clients (e.g. Outlook, Outlook Express or Eudora)
- Specify individual email addresses for each file within the file name!
- Send to email lists, e.g. to automate dispatch of newsletters
- Free for private and commercial use !
Runs on Win 95, 98, ME, NT and Win 2000/XP/2003 ! (also Windows Server 2000 and 2003) I didn’t test it on Windows Server 2008 but should also work fine.
BEEE can also monitor particular folder for files (you can define mask for filenames and extension) and after file detection in directory will send files automatically to defined destination.
Application download, more info and free commercial licence key
// Example: add meta tag with refresh command
protected void Page_Load(object sender, EventArgs e)
{
string strCurrentURL = "http://localhost/test";
// Add meta tag with refresh command
string strRefreshSeconds = "3"; // how many seconds
HtmlMeta metaTags = new HtmlMeta();
metaTags.HttpEquiv = "refresh";
metaTags.ID = "EnterHereSomeUniqueName";
metaTags.Content = strRefreshSeconds + ";URL=" + strCurrentURL;
Header.Controls.Add(metaTags);
}
--SQL Server stores milliseconds with a precision of 1/300ths of a second.
-- So in other words, milliseconds are stored as:
--.000
--.003
--.007
--.010
--.013
--.017
-- etc.
SET DATEFIRST 1
SET DATEFORMAT ymd
SELECT
DATEADD(ms, 0, CONVERT(varchar(10), GETDATE(), 120)) as 'StartToday'
,DATEADD(ms, -3, CONVERT(varchar(10), GETDATE()+1, 120)) as 'EndToday'
Result:
StartToday EndToday
----------------------- -----------------------
2008-09-22 00:00:00.000 2008-09-22 23:59:59.997
(1 row(s) affected)
// 1st method, more elegant
ListItem li = dropdownlist.Items.FindByValue(strValue);
if(li != null)
dropdownlist.Items.Remove(li);
// 2nd method, all in one line but less readable
dropdownlist.Items.RemoveAt(
dropdownlist.Items.IndexOf(dropdownlist.Items.FindByValue(strValue))
);
Microsoft SQL Server 2005/2008
Run this code in your database context in SQL Management Studio:
SELECT
'DROP PROCEDURE [' + name + ']'
as 'CopyThisColumnAndExecuteToDeleteAllProcedures'
FROM
sys.procedures
WHERE
[type] = 'P'
AND is_ms_shipped = 0
AND [name] NOT LIKE 'sp[_]%diagram%'
ORDER BY
[name] ASC

Copy generated statements and just run them to DELETE these stored procedures.


Simply the best!
Same method you can use for tables or other objects.
Only numbers, capital, small letters (English) and spaces are allowed. String length must be between 1 to 10 characters.
Regex:
^[A-Za-z0-9 ]{1,10}$
If you would like to add some chars for example: ,.- then just add them like that:
Regex:
^[A-Za-z0-9 ,.-]{1,10}$
Take a look on pack of very nice date functions, conversions, calculations.
Thanks to Pinal Dave(http://www.SQLAuthority.com) and Vivek Jamwal
—-Yesterday
SELECT DATEADD(d,-1,GETDATE()) 'Yesterday'
—-First Day of Current Week
SELECT DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0) 'First Day of Current Week'
—-Last Day of Current Week
SELECT DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6) 'Last Day of Current Week'
--First Day of Last Week
SELECT DATEADD(wk,DATEDIFF(wk,7,GETDATE()),0) 'First Day of Last Week'
All (much more!) statements you can see in original post on SQLAuthority: here
Check if time is in 24h format hh:mm For example these values are valid: 01:00 (leading zero is mandatory), 05:01, 13:00, 23:59. For example these values are not valid: 24:00, 1:30, 05:60, 12|34 etc.
Regex:
([0-1]\d|2[0-3]):([0-5]\d)
Valid format: whatever@whatever.whatever
Regex:
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*