hi,
I stuck with one query in sp. In my aspx page one Text box named
txtMoney and two buttons
btnAdd and btnUpdate this records is saving to
tblCash.
think cash is 10000 i mean sample..while adding 5000 then it should add to that remaining amount 10000+5000=15000.it should update if i click
btnadd button..and update button is to less amount from
tblCash table so whenever i place some money and if i click
btnupdate button it should be minus from total cash..
can any one help me to create sp..
thanks and regards..
i forgot to mention column in tblCash
tblCash contains cCash column so i want to update this column while adding and less..can any one suggest me..
or can any one suggest me to create simple query..
like in update tblCash(cCash)values(@Cash//so here wat have to give i mean mathematic query to add for same colum i mean update)
@Mohd Wasif how to call in aspx.cs page..i gave query like this
protected void btnAdd_Click(object sender, EventArgs e)
{
txtAmount.Text = "";
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["dbConnection"].ToString());
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "usp_InsertUpdateRecord";
SqlParameter cash=new SqlParameter("@Cash",SqlDbType.Decimal);
cash.Value =txtAmount.Text;
cmd.Parameters.Add(cash);
cmd.ExecuteNonQuery();
lblMessage.Text = "Amount Added";
txtAmount.Text = "";
lblMessage.Text = "";
con.Close();
cmd.Dispose();
}
but am Getting Error like Failed to convert parameter value from a String to a Decimal.
can u suggest me wat have to modify again..