Wednesday, November 11, 2009

How to Use Functions in Asp.net !!

Protected void MyCart()
{
string txtqty=txtCartQty.Text;
string temid=lblid.text;
decimal t;


t=Convert.ToDecimal(tprice.Tostring()* Convert.Tostring.ToDecimal(txtqty.Tostring());


update(txtqty, t.ToString(),temid )

/* update function is called in MyCart Function , and txtqty are actual parameters*/

}

/* update function are Defined here */

private void update(string txtQ, string txtP, string textT)// thies ar formal parametes

{

ccon.open();
string str= "update tblMyCart set
MyCart_Qty='"+txtQ+"', MyCart_Price='"+txtP+"'where MyCart_id="+id+";
";

}

No comments: