View Single Post
  #1 (permalink)  
Old May 28th, 2007, 03:44 PM
luisxvarg luisxvarg is offline
Registered User
 
Join Date: May 2007
Location: Rosario, Santa fe, Argentina.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to luisxvarg Send a message via MSN to luisxvarg
Default Error code: Chapter 17 Pag 576

if you test datagridview Project and try to update datarow throw exception

You read this code:

<asp:SqlDataSource ID=”sdsAuthors” Runat=”server”
ProviderName = "System.Data.SqlClient"
ConnectionString = "Server=bnewsome; User ID=sa;
Password=!p@ssw0rd!;Database=pubs; "
SelectCommand = "SELECT au_id, au_lname, au_fname, phone,
address, city, state, zip FROM authors"
UpdateCommand = "UPDATE authors SET au_lname = @au_lname,
au_fname = @au_fname, phone = @phone, address = @address,
city = @city, state = @state, zip = @zip
WHERE au_id = @original_au_id" >

 <UpdateParameters>
         <asp:Parameter Type="String" Name="au_lname"></asp:Parameter>
         <asp:Parameter Type="String" Name="au_fname"></asp:Parameter>
         <asp:Parameter Type="String" Name="phone"></asp:Parameter>
         <asp:Parameter Type="String" Name="address"></asp:Parameter>
         <asp:Parameter Type="String" Name="city"></asp:Parameter>
         <asp:Parameter Type="String" Name="state"></asp:Parameter>
         <asp:Parameter Type="String" Name="zip"></asp:Parameter>
         <asp:Parameter Type="String" Name="au_id"></asp:Parameter>
      </UpdateParameters>

and no works, so to fix it change the line

WHERE au_id = @original_au_id" >

with the line

WHERE au_id = @au_id" >

and now it works






Civil Engineer, VB developer