Posts

Showing posts from 2012

Software Development Life Cycle

 Software Development Life Cycle (SDLC)  also called as the System Development Life Cycle, is a methodology followed while developing or maintaining a software application. These cycles includes all phases of development of software i.e. from its initial stage to delivery and live. Stages of a process may vary company to company policies. To develop application software, it is very important to analyze its risk factors and scope of the project, and to deliver a logical concept into real world application. Off course you need a suitable framework that can manage every stage of development. SDLC is a framework that defines the activities performed at each stage of software service project. Types of SDLC: Waterfall Model V-Shaped Model Incremental Model Spiral model Rapid Application Model (RAD) Dynamic System Development Method (DSDM) Adaptive SDLC Tailored SDLC Model

Send SMTP mail using C# & .NET

Sending mail via web application or service, is now a days are very common. Most of user demands for email notifications or similar feature in their applications. There numerous of scripts are available to send mail. If you are using C# and .NET framework, and you want a code behind script to customise or create a dynamic mail using C# classes, you can use the following lines of code to generate and send SMTP mail. using System.Net.Mail; MailMessage mail = new MailMessage(); mail.To.Add(" to-mail@gmail. com "); mail.From = new MailAddress(" from@gmail.com "); mail.Subject = "Test Email"; string Body = " Hello Navin, Your online transaction id and password are as: User Name: user-name@gmail.com Password: user-name-password "; mail.Body = Body; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = " smtp.your-site.com "; smtp.Credentials = new System.Net.NetworkCredential(" to-mail@gmail.

Features of MS SQL Server 2012

Microsoft has introduced SQL Server 2012 to the world and it's time for IT professionals to start to come to speed on what's new in this highly anticipated version of SQL Server. This article posted by Joey D'Antoni in his article that I liked and wish to share with you. 1. AlwaysOn Availability Groups -- This feature takes database mirroring to a whole new level. With AlwaysOn, users will be able to fail over multiple databases in groups instead of individually. Also, secondary copies will be readable, and can be used for database backups. The big win is that your DR environment no longer needs to sit idle. 2. Windows Server Core Support -- If you don't know what Windows Server Core is, you may want to come up to speed before Windows 8 (MS is making a push back to the command line for server products). Core is the GUI-less version of Windows that uses DOS and PowerShell for user interaction. It has a much lower footprint (50% less memory and disk spa

Get last day of a given month in SQL Server

One way to find the last day of a given month is to get the next month’s first day and then get the previous day of the particular day. The complete SQL query has given below. The query is not much complex but you may need to do some date calculation here. The query can be written as: declare @mm varchar(2), @yy varchar(4), @dd varchar(2), @date datetime set @date=convert(datetime, '4/16/2012') Set @mm=(Select datepart(M, @date)) Set @yy=(Select datepart(YYYY, @date)) Set @dd= (Select Day(DATEADD(month, 1, DateAdd(day, 1-day(@date), @date))-1)) Select DATENAME(DW, ''+@mm+'/'+@dd+'/'+@yy+'') Output: For: 4/16/2012 :- Monday For: 5/16/2012:- Thursday etc..

Object reference not set to an instance of an object

With C# .Net, many times you may need to typecast an object value to string. And you might have noticed that it throws null reference exception as ”Object reference not set to an instance of an object”. This is a run time exception & will occur mostly when you try to typecast a null value to string. For example: String userId = Session[“user”].ToString(); Above code will run fine until Session[“user”] have some value but throw exception when it has null value. You can sort out these problem by casting it through Convert.ToString(). For example: String userId = Convert.ToString(Session[“user”]); Now your code will not throw any such exception even when it has null value and will cast null value to empty string. Code project reference