Hello, I have searched high and low on the web for a "How to" on using the SqlDataSource Update method and I still cannot get my data to update in the database. Here is my code.
this.TARNetDateTimeFormView.DataBind();
TextBox localText = (TextBox)this.TARNetDateTimeFormView.Controls[0].FindControl("txtLoginDateTime");
localText.Text = DateTime.Now.ToString();
//this.TARNetDateTimeFormView.UpdateItem(false);
this.TARNetUsersSqlDataSource.UpdateParameters["LoginDateTime"].DefaultValue = DateTime.Now.ToString();
this.TARNetUsersSqlDataSource.Update();
The text box on the web page gets updated, but the data in the db does not. I also have the control on the FormView set to two-way data binding.
Thanks in advance for any suggestions! I've tried moving around that DataBind method, too.
Carolyn
this.TARNetDateTimeFormView.DataBind();
TextBox localText = (TextBox)this.TARNetDateTimeFormView.Controls[0].FindControl("txtLoginDateTime");
localText.Text = DateTime.Now.ToString();
//this.TARNetDateTimeFormView.UpdateItem(false);
this.TARNetUsersSqlDataSource.UpdateParameters["LoginDateTime"].DefaultValue = DateTime.Now.ToString();
this.TARNetUsersSqlDataSource.Update();
The text box on the web page gets updated, but the data in the db does not. I also have the control on the FormView set to two-way data binding.
Thanks in advance for any suggestions! I've tried moving around that DataBind method, too.
Carolyn