Chinna Netha

Chinna Netha

  • NA
  • 282
  • 137k

can not update data to database in asp.net c#

Aug 5 2015 12:03 AM
alter PROCEDURE user_about_you_table
@email_id varchar(100),
@position varchar(max),
@city_town_1 varchar(max),
@description varchar(max),
@city_town_2 varchar(max),
@state varchar(max),
@country varchar(max),
@story varchar(max),
@about_you varchar(max),
@nick_name varchar(max),
@favorite_quote varchar(max)

as
begin
select * from about_you_table
end
set nocount on;
if EXISTS(select 1 from about_you_table where email_id=@email_id)
BEGIN
UPDATE about_you_table set position=@position,city_town_1=@city_town_1,description=@description,
city_town_2=@city_town_2,state=@state,country=@country,story=@story,about_you=@about_you,
nick_name=@nick_name,favorite_quote=@favorite_quote where email_id=@email_id
end
else
begin
insert into about_you_table(email_id,position,city_town_1,description,city_town_2,state,country,story,about_you,nick_name,favorite_quote)
values(@email_id,@position,@city_town_1,@description,@city_town_2,@state,@country,@story,@about_you,@nick_name,@favorite_quote);
end







Answers (4)