Click here to Skip to main content
15,885,878 members
Articles / Web Development / ASP.NET

Display/Store and Retrieve Image Data from Database to Gridview, and also on Mouse Over

Rate me:
Please Sign up or sign in to vote.
4.44/5 (21 votes)
15 Oct 2011CPOL4 min read 127.9K   9.9K   50  
How to Display/Store and Retrieve Image Data from Database to Gridview, and also on mouse over
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tools
{
    public class Tools
    {
        public static int IifInt(object obj)
        {
            if (obj != null)
            {
                return Convert.ToInt32(obj);
            }
            return 0;
        }
        public static int IifInt(string obj)
        {
            if (obj == string.Empty)
            {
                 return 0;
            }
            if (obj != null)
            {
                return Convert.ToInt32(obj);
            }
            return 0;
        }

        public static double IifDbl(object obj)
        {
            if (obj != null)
            {
                return Convert.ToDouble(obj);
            }
            return 0.00;
        }
        public static double IifDbl(string obj)
        {
            if (obj != null)
            {
                return Convert.ToDouble(obj);
            }
            return 0.00;
        }

        public static string IifStr(object obj)
        {
            if (obj != null)
            {
                return Convert.ToString(obj);
            }
            return string.Empty;
        }
        public static DateTime IifDT(object obj)
        {
            var retVal = Convert.ToDateTime("01/01/01");
            if (obj != null)
            {
                try
                {
                    retVal = Convert.ToDateTime(obj);
                }
                catch (Exception)
                {
                    return retVal;
                }
            }
            return retVal;
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) ***
Philippines Philippines
MCTS - Microsoft Certified Technology Specialist.
An Accountant.
Had been developed Payroll Accounting System Application
Live in: Quezon City, Metro Manila Philippines
Could reached at email address: ag_mojedo@live.com

Comments and Discussions