mohammed shamsheer

mohammed shamsheer

  • NA
  • 394
  • 144.5k

Cannot reterive date from textbox and send in to object?

Feb 22 2012 12:14 AM
protected void Hardware_add_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(strConn);
con.Open();
SqlCommand ObjHardwarecmd = new SqlCommand("insert into Asset_Hardwaredetails(@hardware_id,@hardware_name,@vendor_name,@manufacturer,@hardware_description,@hardware_model,@purchase_date,@valid_up_to,@price)", con);
.
.
.
,SqlParameter Parampurchase_date=newSqlParameter("@purchase_date",SqlDbType.Date);
SqlParameter Paramvalid_up_to=new SqlParameter("@valid_up_to",SqlDbType.Date);

.
.
.
.
Parampurchase_date.Value = txtFdueon.Text;
Paramvalid_up_to.Value = txtvalid_up_to.Text;


.
.
.
SqlParameter[] ObjHardware = { Paramhard_id,Paramhardware_name, Paramvendor_name, Parammanufacturer, Paramhardware_desctiption, Paramhardware_mode, Parampurchase_date, Paramvalid_up_to, Paramprice };
ObjHardwarecmd.Parameters.AddRange(ObjHardware);
ObjHardwarecmd.ExecuteNonQuery();
Response.Redirect("Hardware_view.aspx");

,,,,,,,,,,,,,,,,,,,,,,,,,,,

Parampurchase_date.Value = txtFdueon.Text;
Paramvalid_up_to.Value = txtvalid_up_to.Text;

cant put .Text after txtFdueon and txtvalid_up_to ?????



Answers (2)