'Investor.cmdSa veEduCost' is a 'field' but is used like a 'method'
the HTML code is...
<asp:Button ID="cmdSaveEduC ost" runat="server" Text="Save" OnClick = "cmdSaveEduCost " />
and the C# code is as folow...
protected void cmdSaveEduCost_ Click(object sender, EventArgs e)
{
string connectionStrin g = ConfigurationMa nager.Connectio nStrings["sqlFWA"].ConnectionStri ng;
SqlConnection conn = new SqlConnection(c onnectionString );
SqlCommand command = new SqlCommand();
//command.Paramet ers.AddWithValu e("@Investor_ID ", Session["sInvestor_ ID"]);
command.Paramet ers.AddWithValu e("@ItemDescrip tion", ItemDescription .Text);
command.Paramet ers.Add("@Annua lCost", SqlDbType.Money ).Value = AnnualCost.Text ;
command.Paramet ers.AddWithValu e("@CPIChildCos t", CPIChildCost.Te xt);
command.Paramet ers.AddWithValu e("@ChildCostIt emTotal", ChildCostItemTo tal.Text);
command.Command Type = CommandType.Sto redProcedure;
command.Command Text =("[dbo].[NavinInsertComm and]");
command.Connect ion = conn;
conn.Open();
command.Execute NonQuery();
grdEduChild.Dat aBind();
conn.Close();
ItemDescription .Text = "";
AnnualCost.Text = "";
CPIChildCost.Te xt = "";
ChildCostItemTo tal.Text = "";
}
the HTML code is...
<asp:Button ID="cmdSaveEduC ost" runat="server" Text="Save" OnClick = "cmdSaveEduCost " />
and the C# code is as folow...
protected void cmdSaveEduCost_ Click(object sender, EventArgs e)
{
string connectionStrin g = ConfigurationMa nager.Connectio nStrings["sqlFWA"].ConnectionStri ng;
SqlConnection conn = new SqlConnection(c onnectionString );
SqlCommand command = new SqlCommand();
//command.Paramet ers.AddWithValu e("@Investor_ID ", Session["sInvestor_ ID"]);
command.Paramet ers.AddWithValu e("@ItemDescrip tion", ItemDescription .Text);
command.Paramet ers.Add("@Annua lCost", SqlDbType.Money ).Value = AnnualCost.Text ;
command.Paramet ers.AddWithValu e("@CPIChildCos t", CPIChildCost.Te xt);
command.Paramet ers.AddWithValu e("@ChildCostIt emTotal", ChildCostItemTo tal.Text);
command.Command Type = CommandType.Sto redProcedure;
command.Command Text =("[dbo].[NavinInsertComm and]");
command.Connect ion = conn;
conn.Open();
command.Execute NonQuery();
grdEduChild.Dat aBind();
conn.Close();
ItemDescription .Text = "";
AnnualCost.Text = "";
CPIChildCost.Te xt = "";
ChildCostItemTo tal.Text = "";
}
Comment