an idiot (cndnbcn85) wrote in aspdotnet,
an idiot
cndnbcn85
aspdotnet

update form

I'm trying to create an item update page for a product database, and was wondering if there's something similar to

<asp:SqlDataSource id="updatesel" runat="server"< br /> ConnectionString="server=...;database=...;uid=...;pwd=..."
SelectCommand="SELECT * FROM database WHERE (ID = @ID)" >
<SelectParameters>
<asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="String"
DefaultValue="%" />
</SelectParameters>

for updating and inserting? I use code like that for search queries, and tried changing "select" to "update" in the code to see if that might work, but no luck. I want there to be a 1st page where you select the product to be updated, then that brings you to a form that has all the product info inserted into the form (with the ID disabled), then you can edit and after submitting, it goes to the 3rd page that gives the success message and updates the table. I have the fist two pages working fine, the form populated with the right data, but after hitting submit, I don't get an error regarding the coding, but no data is updated. I tried using the datagrid method on the MSDN site, because it has worked for inserting new data, but, besides also being kinda bulky to use, it didn't work either. Any suggestions?
  • Post a new comment

    Error

    default userpic
  • 1 comment