Hi All,
I have a datasource with an insert command and parameters as below.
The textboxes referred to are populated and can be edited.
Only trouble is when I run the Update method of the datasource the original textbox value is used in the update (I.e. no change) instead of the new one I type in the text box.
I have a button that simply runs the update method
I get the feeling that I should be doing something else to make the button read the new values of the text box - but I can't find what, can anyone help?
ta
C
...code below
InsertCommand="INSERT INTO jobs (job_title, job_type, job_description, job_location, job_salary) VALUES (@job_title,@job_type,@job_description,@job_location,@job_salary)" SelectCommand="select * from jobs" UpdateCommand="UPDATE jobs SET job_title = @job_title ,job_type = @job_type , job_description = @job_description , job_location = @job_location, job_salary = 'dosh' WHERE job_id = @job_id">
<UpdateParameters>
<asp:ControlParameter ControlID="txbTitle" Name="job_title" PropertyName="text" />
<asp:ControlParameter ControlID="txbType" Name="job_type" PropertyName="text" />
<asp:ControlParameter ControlID="txbDescription" Name="job_description" PropertyName="text" />
<asp:ControlParameter ControlID="txbLocation" Name="job_location" PropertyName="text" />
<asp:ControlParameter ControlID="txbSalary" Name="job_salary" PropertyName="text" />
<asp:ControlParameter ControlID="litJob_id" Name="job_id" PropertyName="text" />
</UpdateParameters>
I have a datasource with an insert command and parameters as below.
The textboxes referred to are populated and can be edited.
Only trouble is when I run the Update method of the datasource the original textbox value is used in the update (I.e. no change) instead of the new one I type in the text box.
I have a button that simply runs the update method
I get the feeling that I should be doing something else to make the button read the new values of the text box - but I can't find what, can anyone help?
ta
C
...code below
InsertCommand="INSERT INTO jobs (job_title, job_type, job_description, job_location, job_salary) VALUES (@job_title,@job_type,@job_description,@job_location,@job_salary)" SelectCommand="select * from jobs" UpdateCommand="UPDATE jobs SET job_title = @job_title ,job_type = @job_type , job_description = @job_description , job_location = @job_location, job_salary = 'dosh' WHERE job_id = @job_id">
<UpdateParameters>
<asp:ControlParameter ControlID="txbTitle" Name="job_title" PropertyName="text" />
<asp:ControlParameter ControlID="txbType" Name="job_type" PropertyName="text" />
<asp:ControlParameter ControlID="txbDescription" Name="job_description" PropertyName="text" />
<asp:ControlParameter ControlID="txbLocation" Name="job_location" PropertyName="text" />
<asp:ControlParameter ControlID="txbSalary" Name="job_salary" PropertyName="text" />
<asp:ControlParameter ControlID="litJob_id" Name="job_id" PropertyName="text" />
</UpdateParameters>