Hi my problem is that so I can't add new data to database.
I wrote procedure in mssql 2008 and now i don't now how coneecting this with asp.net
Create procedure [dbo].[addData]
@name nvarchar(50),
@telephone int,
@place nvarchar(50),
@street nvarchar(50)
AS
Declare
@person_id int,
@place_id int
BEGIN
if not exists(select Person.name,Person.telephone from Person where telephone=@telephone)
begin
print'exist in database'
return
select @Person_id=Person_id from Person where telephone=@telephone
end
IF EXISTS (SELECT Place.place,Place.street FROM Place )
SELECT @place_id=place_id FROM Place
insert into Person(person_id,name,telephone)
values(@person_id,@name,@telephone)
insert into Place(place,street)
values(@place,@street)
end