getting error while updating in grid view

Posted by Rickeybglr under ASP.NET on 7/13/2011 | Points: 10 | Views : 1425 | Status : [Member] | Replies : 2
hi,
i am trying to update row in gridview using store procedure. i am getting error "too many arguments" bcoz of reason, i dnt know how to bind grid view columns to store procedure parameters
in this case grid view has data from 3 different tables and i want to update in all 3 tables.
SP
ALTER PROCEDURE sp_upd
(@pk_contact_id int,@city varchar (30),@email varchar(30),@phone_no numeric)

AS
BEGIN


SET NOCOUNT ON;


UPDATE table1 SET city=@city where pkcontact_id=@pk_contact_id
UPDATE table2 SET email=@email where fk_contact_id=@pk_contact_id
UPDATE table2 SET phone_no=@phone_no where fk_contact_id=@pk_contact_id




Responses

Posted by: Lakn2 on: 7/13/2011 [Member] Starter | Points: 25

Up
0
Down
put readonly=true if you are using bound field directly you can put that property or your are using
templatefield put in any control like
<templatefield>

<itemtemplate>
<asp:textbox id="textbox1" runat="server" readonly="true"....>
......

and too many arguments means you are not sending all arguments to stored procedure. otherwise pase your code i check it.

Thanks&Regards
LakshmiNarayana Nalluri.

Rickeybglr, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rickeybglr on: 7/13/2011 [Member] Starter | Points: 25

Up
0
Down
i knw the reason of too many arg..error. but my quest is tht how can i bind the grid view columns to store procedure parameters

Rickeybglr, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response