Sunday, February 21, 2010

C# - send email by SmtpClient using Gmail SMTP


...
using System.Net.Mail;
using System.Net;
...
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@sampleApp.com");
mail.To.Add("you@sampleApp.com");

//set the content
mail.Subject = "C# mail - Sent by System.Net.Mail";
mail.Body = "this is the body content of the email.";
mail.BodyEncoding = UTF8Encoding.UTF8;

// Delivery notification setting
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;

// SMTP client settings
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.EnableSsl = true;
smtp.Timeout = 10000;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("iborn2code", "farhad2006");

//send the message
smtp.Send(mail);
...

Share/Bookmark

Tuesday, February 16, 2010

Windows Phone 7 Series


During the Mobile World Congress 2010 in Barcelona, Microsoft revealed details of Windows Phone 7 Series
In a nutshell, Xbox Live games and Zune music are now features of Windows Phone 7. These phones arrive by holiday 2010 (may be it's too late).

With the specification requiring all Windows Phone 7 Series devices to feature three buttons, Back button, Start button and Search button. On the other hand, HTC released three new phones and proclaimed the company's commitment to Windows Phone 7 on Tuesday (Feb 16, 2010).

About hardware requirements, No mention has been made of the underlying hardware, although in one of the videos on the Series 7 YouTube page, a Qualcomm representative talks about its Snapdragon chip, a 1GHz ARM-based chip that currently powers Google’s Nexus One.

Windows Phone 7 Series
Windows Mobile
Image gallery
Picture gallery
A 22 minutes demo about Windows Mobile 7
Share/Bookmark

RollBack in VSS when you don't have rollback permission

When you don't have rollback permission, you can replace a version of file with the new version and keep the project running safely.

It's based on Visual Source Safe but the idea is simply general.

• Select the file in VSS Explorer.
• Check out the file using the Check Out command on the SourceSafe menu or by right clicking on the file and choosing the command from the context menu.
• Choose Show History from the Tools menu.
• To show the History of File, click OK.
• Select a file version which you want to back to and click on Get.
• In the Get dialog box, click OK.
• In response to the message asking whether to replace the checked out file, click on Replace.
• Click Close to quit the History of File dialog box.
• Use Check In command on the SourceSafe menu or from context menu which appears by right clicking.
Share/Bookmark

VS 2008 - Microsoft.VisualStudio.DataDesign.SyncDesigner.SyncFacade.SyncManager Error

I experience the following error message when I wanted to get connected to a database on a SQL 2008 Express from a machine with a newly installed Visual Studio 2008.

When I tried "Add New Data Source" and after creating connection string at the time of proceeding to finalize the connection, the Error Message came up:

Could not load type 'Microsoft.VisualStudio.DataDesign.SyncDesigner.SyncFacade.SyncManager' from assembly 'Microsoft.VisualStudio.DataDesign.SyncDesigner.DslPackage.Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

The simple solution which worked for me was installing VS 2008 SP1, at this moment it's available at:
http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=fbee1648-7106-44a7-9649-6d9f6d58056e&displayLang=en
Share/Bookmark

Sunday, January 31, 2010

SQL - Cross Apply


Share/Bookmark

Friday, January 29, 2010

C# - Call method of a string namespace


Share/Bookmark

Friday, January 8, 2010

.NET - Hashtable vs ArrayList


Share/Bookmark

Tuesday, December 29, 2009

C# - XPathNavigator class to navigate XML


Share/Bookmark

Wednesday, December 16, 2009

T-SQL - Synonyms


Share/Bookmark

Saturday, December 12, 2009

Visual Studio - Import and Export Settings

As you know we can customizing the IDE in Visual Studio, if you change the place of toolbox, properties window, server explorer, or some other features, you can save your setting to keep it for later and if you need to move to another machine or setting back to this point either if you changed something more and you didn't like it, just simply bring it back to your saved settings.


General settings, Browsers, Start page commands, Toolbox, help filters, options, and ... are all customizable and possible to save them all and assign a name to this set.



On the other hand, we can reload pre saved settings,


Good naming for saved settings will help a lot at this point


And at last we can reset all the customized settings to default state.


This feature is very useful but somehow hidden, customizing the environment will hep your productivity, then just using it and make it work the way you want it.
Share/Bookmark