hi same week and am here again with another problem lol

and yeah its my homework and am stuck somewhere as 95 % has been finished.

Windows Form Application--- using C sharp and SQL server 2008


i made database in SQL server 2008 and using visual basic 2008 C sharp

created 3 form
one for welcome

1 for showing book table in grid view

and 1 for showing individual records

pleaseee Helppppp

scnerioa is below.....


In this task you will create a windows application that will display and update an external database (BookSeller) with a single table (Books), via ADO.Net and several data form(s). You are required to create a suitable database for this task.
A software development company (Nescom Solutions) is developing a program for use with a client’s BookSeller database. As a contracted employee of Nescom Solutions you have been asked to design, create and test software which will display and update the tblBooks table. The interface to the database table must enable the user to do the following:
• Display individual records
• Add a new record
• Delete a record
• Cancel amendment for a record
• Cancel all amendments made to the table since the last save
• Save changes to the database

Need help with Red ones, am trying to find out solution but in mean time if anyone could help would be really appreciated

Recommended Answers

All 15 Replies

:/ help ????

found sumthing for console but nothing for windows form

You are required to create a suitable database for this task.

Cancel all amendments made to the table since the last save

I would create a duplicate Books table, for example BooksRestore. Every time the user commits changes to information in the details of the book, you insert the original row from Books to BooksRestore table. After that you save the changes to the Books table.

Your Books table probably has some unique BookID as a primary key. Since the user can modify the same book more than once, that ID can't be unique in BooksRestore.

Restoring data happens by taking rows from the BooksRestore table (in reverse order i.e. last change is done first) and updating the Books table with that row's data (except BookID's value). After processing all the rows in BooksRestore table, you delete all the rows from it and it's ready for the next save/restore.

Cancel amendment for a record

Just put a Cancel-button to the details form. If the user presses Cancel, you don't update that record.

Not a single line of code, but I hope you got the idea. There can be other ways to implement restoring, but this is definitely a simple and a straightforward method.

HTH

first thanks alot for ur time to read my query...

Cancel amendment for a record
Just put a Cancel-button to the details form. If the user presses Cancel, you don't update that record.

Not a single line of code, but I hope you got the idea. There can be other ways to implement restoring, but this is definitely a simple and a straightforward method.

HTH

i got the idea over here, as its simply straight forward...

as even if i close the respect form wihtout pressing "SAVE" button it dunt save anything in database.. soo all i will do is put a "cancel" button which will reopens the form i think after closing it
bit complex buh i will be able to do it.


now important thing

i will have to create a dublicate table...
hmm yeah pretty easy can do that

buh for the coding bit,,,, is it possible to get any example or something soo i can see how it will actually work,, as its sounds a bit complex to me...

new 2 VS 2008...

Cheers :)

not gonna stop.. going to search myself as well :)

why dont i just create a event on Save button ...

on which when, a user clicks on save button, it creates a dublicate table and save it
and later when i press "cancel untill last modified" it just fetch back that currently saved table back...

and create a constructor which will save table dublication when the program starts...


my logic sounds well complex 2 me tbh lol

still thinking

any guide wud b appreciatble :) !

aint gettin any helpful material arund :(
any help pple ??

What h/w is this for? University?

why u wanna know

dunt tell me if u r from same uni :/ !!

yeah it is actually :/

Some one will gonna help me then :/

Why no ones helping me :( :( :(

:( pleaseeeeee help m struk :'(

stuck****

Why no ones helping me

I did help you. I outlined one solution to your problem.

Have you read DaniWeb Rules? Here's a quote from the rules:

Do provide evidence of having done some work yourself if posting questions from schoolwork assignments

commented: Good point. +8

Try creating a second table but not a duplication of 'Books', Rather a table that you could call 'Changes'. When a record in Books is changed store all the data about the change ie: the book ID, the field changed, the original entry.

To undo the changes get this data from the 'Changes' table a and use that to re-update the Books table.

sorry i cant access the other account at the moment soo using friends account...

I forgot to tell that.. i just created data source and a form and moved the data source table on to the form and it automatically gave me add button, delete button, edit button and navigators for individual records ....

my point is i havn;t done any of my own coding to call the data from database or save it using commands...

sooo i am struggling with code as i cannt put any code for saving data to a new table changes when i havn;t wrote a code to display or add data..

am bit confuse my self but i think i am going sumwhere atleast !

cheers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.