Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET Database and Reporting > SQL DataBase Updates Only Temporally


Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2009, 05:59 AM
jerryeagle jerryeagle is offline
Newcomer
 
Join Date: Jan 2009
Posts: 2
Default SQL DataBase Updates Only Temporally


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
Reply With Quote
  #2  
Old 01-20-2009, 07:07 PM
jerryeagle jerryeagle is offline
Newcomer
 
Join Date: Jan 2009
Posts: 2
Default

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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->