Load Counter
motorcycle helmets

Saturday 16 November 2013

How to specify password policy to a textbox control


To validate the textbox control with some specific digit in C# coding for a Windows Application is the main object of this article. User must be instructed to type password in A-Z, a-z, 0-9 and special character as password/secret code.

Password is secret code or string of characters which is applied to authenticate the identity of user in a system. It is very ancient mechanism to protect system from unauthorized access by using secret code. In order select the password character or digit, most of organization follow some rules and regulation with some password policy.

Here I have given an example for a password validation code snippet by using very simple and basic common algorithm through textbox control in C#. In this rules of password validation, you are allowed to type any alphabet, numeric and special characters as password value.
For more please click on below link:

Monday 11 November 2013

How to Display Picture From Database to Picture Box Control

Here I've given a very simple code snippet with you can display image from database.


private void DisplayPictureFromDB()
{

SqlConnection cnMyPro = new SqlConnection();
 
string qryMyPro = "SELECT Description FROM ProductInfo";
if (cnMyPro.State != ConnectionState.Open)
cnMyPro.Open();

SqlCommand cmdMyPro = new SqlCommand(qryMyPro, cnMyPro);
SqlDataReader sdrMyPro =cmdMyPro.ExecuteReader();
sdrMyPro.Read();

if (sdrMyPro.HasRows)
{

byte[] MyImage = (byte[])(sdrMyPro[2]);
if (MyImage == null)
picDescription.Image = null;

else
{

MemoryStream msMyPro = new MemoryStream(MyImage);
picDescription.Image =Image.FromStream(msMyPro);
 
}
}
}

Sunday 10 November 2013

How to Import data from excel sheet to Access Database using DataGridView control in C#.

In this article, how data can be transferred from excel sheet to a table of Access Database through DataGridView using OleDB database connectivity in C#, is revealed with simple source code. It is complete apps in which you can import data from a particular formatted excel sheet and insert into a table of Access Database with eliminating duplicate data.


To transfer data from one format (system/file) to another format (system/file) is a common and essential task for a software developer. Here I have explained elaborately with very simple code snippet and developed three functions in C# which are the heart of this apps. Firstly, GetExcel() function is called to load data into DataGridView from excel sheet, InsertData() function work to save data into Access Database from DataGridView and third function name is CheckDuplicate() which play role to check the duplicate data.
Excel File Importer