Here is a small demo of a SQL database, where one can add, update delete members from a SQL server.

There are two tables in a single SQL Server DB, one is “members” second is “overview”.

  • In members there is distinct ID column and members personal info like name, address telephone etc.
  • In overview there are only three columns which are dID, year & amount.

There is one single windows form, language is c# and project is built in Visual Studio 2010, and of course data base in SQL Server 2010.

The windows form has a “reset, insert, update & delete” buttons.

  • There is one more button besides the dID text box where a distinct ID can be inserted and after clicking Search button the last entry made about the member shows by filling all the text boxes where name address telephone appear. This serves the function that member full info can be seen and changes can be made or can be removed from dB.
  • There are two text boxes in particular, which are Year & Amount, which shows that the member has paid a certain amount for the certain year.

But as I mentioned in the text boxes you can only see the last entry made. What function I want to achieve is that after inserting dID of person x I could only in the year text box able to insert lets say any previous year and the press search which should like normally fill all the text boxes with info, and in the amount text box should show me the entry from the dB that according to the year I entered how much amount is there or there is nothing which means that may be member has not paid for a certain year.

I need help in achieving this logic programmatically therefore I would like to request assistance.

The present program is as follows :

using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Data.SqlClient;
using System.Drawing; 
using 
Edit
Report