SQL DataBase Updates Only Temporally

jerryeagle
01-18-2009, 05:59 AM
Hi, I'm making a VB Program to Manage a SQL Database, I made a Users Table and a Form to Manage this Table, I have a "New" Button (For adding a new row), a "Save" Button and a "Delete" Button, at first it seems to work but it's just "Temporally", I mean after I Run the Program a few times, the changes I made just go away, and the Table get back to the State before I made any changes, and whrn I make changes, I check the SQL Table but altought when I run the VB program, the Changes do Change the DATA, the SQL Table stays without any change!! I don't know what am I doing wrong!! This is the Code I use:

Insert Prodecdure:
ALTER PROCEDURE dbo.AgregaUserQuery
(
@Id nvarchar(20),
@Clave nvarchar(50),
@Tipo nvarchar(50),
@Fecha datetime
--@Modificado timestamp OUTPUT
)
AS
SET NOCOUNT ON;
INSERT INTO Usuarios
(Id, Clave, Tipo, Fecha)
VALUES (@Id,@Clave,@Tipo,@Fecha);

IF @@ROWCOUNT>0 AND @@ERROR = 0

SELECT @Id=Id

FROM Usuarios;

Delete Procedure:
ALTER PROCEDURE dbo.BorrarUserProcedure
(
@Id nvarchar(20)
)
AS
SET NOCOUNT ON;

DELETE FROM Usuarios Where (Id = @Id);

I have not wrote the UPDATE Procedure yet.

Anyone could help me please??

Thanks

jerryeagle
01-20-2009, 07:07 PM
Never mind, I've just figure it out.

The problem was that I had my database settings on "Always copy" so every time I tested the program, the Database was Copied to output directory (the Debug Folder) I just switched from "copy always" to "Copy if newer".

Bye

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum