Click here to Skip to main content
13,297,513 members (45,034 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Pls Help me.Thanks in advance

<%@ WebHandler Language="C#" Class="ImageHandler" %>
using System;
using System.Web;
using System.Configuration;
using MySql.Data.MySqlClient;
public class ImageHandler : IHttpHandler 

    string strcon = ConfigurationManager.ConnectionStrings["WelfareDB"].ToString();
    public void ProcessRequest (HttpContext context)
        if (context.Request.QueryString["ImID"] !=null)
            string imgid = context.Request.QueryString["ImID"];
            MySqlConnection con = new MySqlConnection(strcon);
            string qry = "select image from inchargedetail where inchargeid=@detailid";
            MySqlParameter detailidP = new MySqlParameter("@detailid", imgid);
            MySqlDataReader dr = MySqlHelper.ExecuteReader(con, qry, detailidP);
    public bool IsReusable
            return false;
Posted 30-Nov-12 19:57pm
pankajgarg1986 1-Dec-12 0:58am
how to check for system.dbnull in if statement

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please see:[^],[^].

For example: DBNull.Value.Equals(someValue); but in general case, first make sure someValue != null.


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171207.1 | Last Updated 16 Dec 2015
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100