Here is the code I a using
CODE
ReservationTableAdapter.InsertReservation(roomLabel.Text, startupForm.checkInDate.Value, startupForm.checkOutDate.Value, startupForm.ttlCost)
GuestTableAdapter.InsertGuest(userNameBox.Text, lastNameBox.Text, firstNameBox.Text, streetBox.Text, cityBox.Text, stateBox.Text, zipBox.Text, phoneBox.Text, cNbr, passwordBox.Text)
and here are the sql statements being used
CODE
INSERT INTO [dbo].[Reservation] ([Room Name], [Check-in Date], [Check-out Date], [Total Room Cost]) VALUES (@Room_Name, @p1, @p3, @Total_Room_Cost);
SELECT [Room Name], [Check-in Date], [Check-out Date], [Total Room Cost], [Confirmation Number] FROM Reservation WHERE ([Confirmation Number] = SCOPE_IDENTITY())
CODE
INSERT INTO [dbo].[Guest] ([User Name], [Last Name], [First Name], [Street], [City], [State], [Zip Code], [Phone Number], [Confirmation Number], [password]) VALUES (@User_Name, @Last_Name, @First_Name, @Street, @City, @State, @Zip_Code, @Phone_Number, @Confirmation_Number, @password);
SELECT [User Name], [Last Name], [First Name], Street, City, State, [Zip Code], [Phone Number], [Confirmation Number], password FROM Guest WHERE ([User Name] = @User_Name) AND (password = @password)
Everything works fine. While the program is running I can view the tables and all the data is there. End and restart the program and its gone.
TB
This post has been edited by TuxBrewer: 23 Apr, 2008 - 03:06 PM