BS in Mechanical Engineering, MBA in Finance and MS in Computer Science

Worked in Rhone Poulenc Rorer, Fisons Bangladesh Ltd, Sanof-aventis.

Worked as a System Engineer in NIK,Japan

Working as a Application Support Developer in Procom, Canada

Convert System.Drawing.Color to RGB and Hex Value

Hoque

Using C# I was trying to develop the following two. The way I am doing it may have some problem and need your kind advice. In addition, I dont know whether there is any existing method to do the same.

private static String HexConverter(System.Drawing.Color c)
{
    String rtn = String.Empty;
    try
    {
        rtn = "#" + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
    }
    catch (Exception ex)
    {
        //doing nothing
    }

    return rtn;
}

private static String RGBConverter(System.Drawing.Color c)
{
    String rtn = String.Empty;
    try
    {
        rtn = "RGB(" + c.R.ToString() + "," + c.G.ToString() + "," + c.B.ToString() + ")";
    }
    catch (Exception ex)
    {
        //doing nothing
    }

    return rtn;
}

Thanks.

Read more

Published: 3/6/2010 10:54:11 PM

Way to insert text having ' (apostrophe) into a SQL table

Hoque

While I was trying the following SQL command , I got sql error.

INSERT INTO exampleTbl VALUES('he doesn't work for me')

where doesn't contain the apostrophe.

What is the way to insert text having ' (apostrophe) into a SQL table.

Read more

Published: 11/30/2011 9:11:28 PM

Convert to Stream from a Url

Hoque

I was trying to convert an Url to Stream but I am not sure whether I am right or wrong.

protected Stream GetStream(String gazouUrl)
{
    Stream rtn = null;
    HttpWebRequest aRequest = (HttpWebRequest)WebRequest.Create(gazouUrl);
    HttpWebResponse aResponse = (HttpWebResponse)aRequest.GetResponse();

    using (StreamReader sReader = new StreamReader(aResponse.GetResponseStream(), System.Text.Encoding.Default))
    {
        rtn = sReader.BaseStream;
    }
    return rtn;
}

Am I on the right track?

Read more

Published: 6/23/2010 7:56:21 PM

How do I get root url using ASP not ASP.net

Hoque

How do I get root url using ASP not ASP.net? I have found this question ( How do I get the site root URL? )

but it is related to ASP.net.

=====================================

Abbas's answer provide me the

parent site root url

but does not provide me the subsite root url

=====================================

Read more

Published: 12/21/2011 10:41:36 PM

How can I make an online Book like http://www.20thingsilearned.com/ [closed]

Hoque

Recently, I have found this site made by Google Team.

http://www.20thingsilearned.com/

So far I understand this is not based on Flash. How can I use this technology to make an online book using their technology?

Read more

Published: 12/30/2010 4:59:09 PM