14/12/2013 by Nitesh

How To Set DateTimePicker controls value blank in C#

Friends, We all have been using the default DateTimePicker control in C# Winforms and in certain scenarios, we need to display a blank value in the DateTimePicker control. By default you can set the control’s value to null or DBNUll.Value. However, this can be done by using a small trick. This post will explain how…

Continue Reading »

22/06/2013 by Nitesh

How to Disable Mouse Scroll in DevExpress LookupEdit Control

Friends, LookupEdit is another one of the most commonly used controls in DevExpress WinForms library as it resembles the default ComoboBox control provided in the default .Net Toolbox. As compared to normal Combobox control, you can display rows of data in a LookupEdit Control. The control by default support AutoComplete feature so when you start…

Continue Reading »

03/06/2013 by Nitesh

How to Disable Mouse Scroll in DevExpress TextEdit Control

Dear Friends, TextEdit is one of the most commonly used controls in DevExpress WinForms library as it resembles the default TextBox control. You can set the TextEdit’s properties to allow restricted entries like only numeric numbers, only numbers with 2 decimal places, currency format etc using the DisplayFormat and EditFormat properties.  If the control’s property…

Continue Reading »

18/12/2012 by Nitesh

Solution: ExecuteNonQuery() always returning -1 when calling a Stored Procedure

Friends, This post details another solution to a very basic problem that we face in our development and tend to miss writing Stored Procedures. We know ExecuteNonQuery() function defined in the SqlCommand class returns the number of rows affected by the query we are executing. Sometimes, when calling a Stored Procedure using the ExecuteNonquery() from…

Continue Reading »

02/11/2012 by Nitesh

How to send Email using Gmail Server

I have seen many developers asking this questions and hence thought of writing this brief post. This post describes the code to send an email in C# using Gmail as mail server. SmtpClient smtpServer = new SmtpClient(“smtp.gmail.com”); smtpServer.Port = 587; smtpServer.Host=”smtp.gmail.com”; smtpServer.Credentials = new NetworkCredential(“username@gmail.com”, “PASSWORD”); smtpServer.EnableSsl = true; MailMessage mail = new MailMessage(); mail.From…

Continue Reading »

1 10 11 12 13 14