Archive for the month March 2009

« Older Entries  

Email Via Gmail in C#

Using this function we can send email from Gmail from C# application.
public bool Gmail_Mailer(string GmailId, string Password, string To, string Subject, string Body, System.Web.Mail.MailFormat Format, string AttachmentPath)
{
try
{
System.Web.Mail.MailMessage myMail = new System.Web.Mail.MailMessage();
myMail.Fields.Add(”http://schemas.microsoft.com/cdo/configuration/smtpserver”,”smtp.gmail.com”);
myMail.Fields.Add(”http://schemas.microsoft.com/cdo/configuration/smtpserverport”,”465″);
myMail.Fields.Add(”http://schemas.microsoft.com/cdo/configuration/sendusing”,”2″);
//sendusing: cdoSendUsingPort, value 2, for sending the message using
//the network.
//smtpauthenticate: Specifies the mechanism used when authenticating
//to an SMTP
//service over the network. Possible values are:
//- cdoAnonymous, [...]

Foreign Key Reference more than 1 table

create table address(addr_No int not null, cust_no int not null, emp_no int not null, blah, blah, primary key(addr_No),
index(cust_No), index(emp_No),
Foreign Key(cust_No) references customer(cust_No),
Foreign Key(emp_No) references employee(emp_No));
Source : http://www.dbforums.com/ansi-sql/983522-foreign-key-referencing-more-than-1-table.html

How to Grant Administrative Rights on SQL Express 2005?

1.      Log in to Windows Vista using your administrative account
2.      Open SQL Server Surface Area Configuration Application ( Start –> All Programs –> Microsoft SQL Server 2005 –> Configuration Tools –>SQL Server Surface Area Configuration)
3.      Click on Add New Administrator (pointed in the image) link
 
4.      A new window with title ‘SQL Server User Provisioning on Vista‘ popup and displays the [...]