Auto update table field

Discussion in 'C#' started by Poojanath, Dec 7, 2007.

  1. #1
    Hi,

    I am developing small asp application.There is a database called
    db.mdb
    and there are three tables(tblUser,tbsImport,tblcitylist)
    In tblcitylist there are two fiedls
    1.Town
    2.LReg
    According to the relevent town there is a LReg (Lreg is a name already assign to the town)
    this part is ok.

    In my tblUser there is a field called Town and LReg (Same as above table)
    But here LReg is empty.I mean there is a default value called "N/A"

    I need to create a asp page for following purpose

    * i need to read tblcitylist table and according to that I need to fill the LReg fields of TblUser

    Ex: if tblcitylist
    Town LReg
    ---- ---
    town1 lreg1

    then,

    tblUser table

    Town LReg
    ---- ---
    town1 N/A ------> here N/A should be updated to value called "lreg1"

    There are about 15 records in my tblUser table

    Hope your answer
     
    Poojanath, Dec 7, 2007 IP
  2. imvain2

    imvain2 Peon

    Messages:
    218
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hmm

    update tblUser,tblcitylist set tblUser.LReg = tblcitylist.LReg where tblUser.Town = tblcitylist.Town
     
    imvain2, Dec 9, 2007 IP
  3. Poojanath

    Poojanath Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks it is working nicely
     
    Poojanath, Dec 9, 2007 IP