Posts

Care your eyes

When we are working in the computer continuously we forget to care our eyes. It will keep on looking the system and gets tired. If this continues we will be having trouble with our eyes. Recently I have installed a chrome extension which is a real good extension to care for the eyes. I am sharing  here to care your eyes too. :) Here is the extension details. eyeCare  - Protect your vision and health. The chrome extension has more information. Install the chrome extension and care your eyes.

Maintain multiple Facebook accounts

If you are having more than one Facebook accounts(or even one) and you can add this extension named "Quick Login for Facebook Accounts" to your Chrome browser. The extension is from the guys who have created the  extension "Quick Login for Gmail" (my previous post ). This is also pretty simple and cool. More information can be found here; Quick Login for Facebook Accounts One click does the magic. :)

Chrome Extension to maintain multiple gmail accounts

It is little harder to keep remember passwords of our Gmail accounts all the time. Recently, I have found the following chrome browser extension "Quick Login for Google Accounts" which solves the above problem. No more worries about the password maintenance. It is also secure. More details about the Quick Login chrome extension; Quick Login for Google Accounts Really good and simple extension. Thanks to the guys who created this.

Simple LINQ - SQL Connecting Program in C#

Image
LINQ - Language Integrated Query.It provides the Querying ability to the database and also doing the DML operations such as insert, update and delete.for more about LINQ, have a look at http://msdn.microsoft.com/en-us/library/bb308959.aspx There are infinite pages are available to describe the Linq, its functionality, and design. But for a beginner, let us go with creating a simple application using Linq and playing with database. Before writing the program, we need to know the following basic things. 1. DataContext This is a Layer or cache kind of stuff which interacts between the database and application. The application uses the datacontext to manipulate data with the database. 2. dbml - Database Markup Language Linq to SQL class is known as dbml. The dbml maintains the tables and linkings. Now we start with creating simple program. The aim of the program is to display the Northwind customers data whose names are starting with "a" in a datagrid. Step 1: Create new C# wi

Character casing in Asp.net

We might used the "Charactercasing" property of Textbox in C# windows applications. This is used to get the input values as upper or lower case without doing the separate coding. But in web applications,this property is not available directly. But we need to achieve this functionality using CSS. In CSS, we need to use the "text-transform" property to make the input text as upper, lower or initcaps. Here is the CSS sample: .makeuppercase { text-transform:uppercase; } .makelowercase { text-transform:lowercase; } .makeinitcaps { text-transform:capitalize; } Need to assign the style name to TextBox "CssClass" property as; TextBox1.CssClass = "makeuppercase" The above code will make the input values to upper case while entering the values.

XML Documentation comments

Image
When we are doing the coding, we need to use our own functions/methods to do a certain task. But while writing the function we may missed out the function details like why the function has been written . So whenever writing a function, if we use the documentation comments standard, it will help in the future whoever uses the function. Here is syntax; /// /// documentation block /// Here is the simple function defined in C# IDE; documentation comments added here; Intellisense is displaying the documentation comments.

Storing Images in MySQL database

Image
We may need to store the images in the database. It is easy and pretty simple. The basic idea is; 1) The images are stored in database as bytes. In MySQL database we need to create a field/column of type " Blob ". 2) Need to use FileStream and BinaryReader objects to convert images into bytes. Here is the C# code, to do the task Table schema: C# code: MySqlConnection mcon = null; MySqlCommand cmd = null; FileStream fsObj = null; BinaryReader binRdr = null; try { //converting image to bytes fsObj = File.OpenRead(pictureBox1.ImageLocation); byte[] imgContent = new byte[fsObj.Length]; binRdr = new BinaryReader(fsObj); imgContent = binRdr.ReadBytes((int)fsObj.Length); mcon = new MySqlConnection("server=localhost;user=root;pwd=root;database=test;"); mcon.Open(); //inserting into MySQL db cmd = new MySqlCommand("insert into users (userid,username,userphoto) values (@userid, @username, @userphoto)", mcon); cmd.Parameters.Add(new MySqlPara