Results 1 to 33 of 33

Thread: [RESOLVED] Transfering Data from one part to other of database to other!!!

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2009
    Posts
    1,103

    Resolved [RESOLVED] Transfering Data from one part to other of database to other!!!

    The form is like this:

    A database contains six columns:
    "From Bank","From Account","From Balance","To Bank","To Account","To Balance"

    On transfer button click,The balanced will be transfered and added to the "To Balance" of "To Account"
    i did the code for form load but i cant get throught the transfer money code:
    Code:
    Imports System.Data
    Imports System.Data.OleDb
    Public Class Form1
        Dim con As New OleDbConnection
        Dim cmd As New OleDbCommand
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            con = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\Users\Gautam\Documents\Visual Studio 2005\Projects\Transfer\Transfer\db1.mdb")
            con.Open()
            cmd = New OleDbCommand("Select * from table1", con)
            Dim da As New OleDbDataAdapter(cmd)
            Dim dt As New DataTable
            da.Fill(dt)
            con.Close()
            ComboBox1.DataSource = dt
            ComboBox1.DisplayMember = "From_Bank_Name"
            ComboBox1.Text = ""
            ComboBox2.DataSource = dt
            ComboBox2.DisplayMember = "From_Account_No"
            ComboBox2.Text = ""
            ComboBox3.DataSource = dt
            ComboBox3.DisplayMember = "To_Bank_Name"
            ComboBox3.Text = ""
            ComboBox4.DataSource = dt
            ComboBox4.DisplayMember = "To_Account_No"
            ComboBox4.Text = ""
        End Sub
    
        Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    
        End Sub
    End Class
    now in button click i want to perform this:
    Original balance(Sender)=Original balance-From_Balance
    Original balance(Receiver)=Original balance+TO_balance
    then
    From_Balance=Original balance(Sender)
    To_Balance=Original balance(Receiver)

    Am I getting it right?

    Please help!!!
    Last edited by gautamshaw; Feb 21st, 2010 at 01:22 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width