Question : MS Acces datbase with Microsoft visual 2008 realted question

this is the question:

1. Create a small BankAccount database with MS Access. Create one Account table in the database. The Account table should have fields for account number, customer last and first names, and current balance, Populate the table with 5-6 records. Design a user interface that allows the user to enter an account number. Your program would retrieve and display the current balance for the account.

and my solution is attached:

My problem is when the console tells me to enter the account number associated with it is where i have problems, could someone help or know website that would explain.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data;

namespace bankAccount
{
   class Program
   {
      static void Main(string[] args)
      {
         DataBaseDemo1();
      }

      static void DataBaseDemo1()
      {
         try
         {

            string sConnection;
            sConnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Dayspace\bank.mdb";
            OleDbConnection dbConn;
            dbConn = new OleDbConnection(sConnection);
            dbConn.Open();
            string sql;
            sql = "Select LastName, FirstName, CurrentBalance From bankAccountTable";          // Note the two semicolons
            OleDbCommand dbCmd = new OleDbCommand();
            dbCmd.CommandText = sql;    // set command  SQL string
            dbCmd.Connection = dbConn; // dbConn is connection object 
            OleDbDataReader dbReader;
            dbReader = dbCmd.ExecuteReader();
            
            while (dbReader.Read())
            {
               Console.WriteLine("Enter Bank account Number ");
               double a = Convert.ToDouble(Console.ReadLine());
               
               Console.WriteLine("First Name: " + dbReader["FirstName"] + "\t Last Name: " + dbReader["LastName"] + "\t Balance: " + dbReader["CurrentBalance"]);
            }

            Console.WriteLine("Reach to the end of table");
            dbReader.Close(); // Close the Reader object
            dbConn.Close(); // Close the Connection object
         }



         catch (Exception e)
         {
            Console.WriteLine(e);
         }
      }
   }
}

Answer : MS Acces datbase with Microsoft visual 2008 realted question

You can calculate from the original equation (y = w^1/3) what y would be if x were 1 + 0.01. Do so. That is your base number.
The approx number is 1 +dx/3.  Calculate, subtract from base number, divide by base number, multiply by 100. That is your percent difference. Repeat with dx = 0.1 and 0.05
Random Solutions  
 
programming4us programming4us