hello

Wednesday, 23 January 2013

n tire Architecture

http://www.mindstick.com/Articles/d36ceb0f-018c-4979-b2f5-a4a1e616cb5b/?N-Tier%20Architecture%20in%20ASP.NET

Tuesday, 22 January 2013

how add connection string

</configSections>
    <appSettings>
        <add key="strLocalCon" value="Data Source=EASY-857AC062F0;Initial Catalog=aaa;Integrated Security=True"/>
    <add key="strLocalCon1" value="Data Source=EASY-857AC062F0;Initial Catalog=aa;Integrated Security=True"/>
    </appSettings>
    <connectionStrings>
        <add name="VeePurchases" connectionString="Data Source=EASY-857AC062F0;Initial Catalog=aa;Integrated Security=True"/>
    <add name="VeeSale" connectionString="Data Source=EASY-857AC062F0;Initial Catalog=aa;Integrated Security=True"/>
    </connectionStrings>

//
    SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["VeePurchases"].ToString());

how send sms using api


protected void btnSend_Click(object sender, EventArgs e)
    {
       
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.sitename.in/pushsms.php?UserName=abc&Password=xyz&Type=Individual&To=" + txtMobileNo.Text + "&Mask=S H A M &Message=" + txtMessage.Text) as HttpWebRequest;
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        Stream receiveStream = response.GetResponseStream();
        Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
        StreamReader readStream = new StreamReader(receiveStream, encode);
        string a = readStream.ReadToEnd().ToString();
        response.Close();
        readStream.Close();

    }

    #region characters as byte array
   
    public string UTF8ByteArrayToString(byte[] characters)
    {
        UTF8Encoding encoding = new UTF8Encoding();
        string constructedString = encoding.GetString(characters);
        return constructedString;
    }

    #endregion

Sunday, 25 November 2012

how pass sp perametrs in sqlhelper

           SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "spname", new SqlParameter("@username", txtuname.Text.ToString().Trim()));

Friday, 23 November 2012

change gridview checkbox color using javascript

 <script type="text/javascript">
        function changecolor(Id) {
            if (document.getElementById(Id).checked == true) {
                document.getElementById(Id).parentNode.style.backgroundColor = 'green';
            }
            else {
                document.getElementById(Id).parentNode.style.backgroundColor = 'red';
            }


        }
    </script>
</head>

onclick="javascript:changecolor(this.id)"

how get database table and no of rows in table

SELECT Name, DCount("*", Name) AS NumberOfRows
FROM MSysObjects
WHERE TYPE IN (1, 4, 6)
AND Name NOT LIKE "MSys*"
ORDER BY Name

Friday, 16 November 2012

how get max id in sql

            SELECT ISNULL(MAX(ISNULL(id, 0)), 0) + 1 FROM temp2