Software development stuff.

2007-06-22

IEnumerable to implement a classe for foreach

If you want to implement a class that can be used with foreach you need to implement an IEnumerable. See Using IEnumerator and IEnumerable in the .NET Framework - The Code Project - C# Programming

Etiquetas:

2007-06-18

How to escape the % (Percent) sign in a LİKE query T-SQL

If you need to search the '%' sign in Transact SQL, cehcvk out the reference page for the LIKE (T-SQL):

USE pubs

GO

SELECT notes

FROM titles

WHERE notes LIKE '50%% off when 100 or more copies are purchased'

ESCAPE '%'

GO

Etiquetas:

2007-06-04

File locked after sent via email attatchment

When sending attatchemnts with System.Net.Mail remember to Dispose.
If you don't invoke Dispose on the attatchment the file remains locked until Garbage Collector takes action.
I preffer to dispose the MailMessage:

Using objMM As New MailMessage
...
...
End Using

Help from here

Etiquetas:

Sending E-mail .NET 1.1 and 2.0

Trying to clean the warnings in VS2005 from a project migrated from .NET 1.1

I had many warnings related with mail sending. Old version is obsolete.

Here's a good reference for this, specially on how to authenticate in the new version.

Etiquetas: