Asp realtime auto detect sql data

Discussion in 'C#' started by ocm1, Nov 20, 2009.

  1. #1
    [​IMG]
    I have to create 3 table (a,b,c)

    table A = client enter name for checking goods

    table B = client goods table

    table C = result

    exmaple:

    Client Side
    when Tan login to the web site,
    keyin name and save into the sql table A. (this part done)

    Server Side
    my question is :
    May I using XMLHTTPRequest?
    or how to detect new data coming?(24 hrs auto detect. no need ppl monitor)
    and when server side detected SQL table A got new data then change
    the table A 'code N' to 'code R'( N means is new data, R is old data)
    last move result to table C.

    example:

    9.00am : Tan login to web site key in name (data save! into sql server)
    9.00am : server side auto detect new data coming at table A,
    change table A code N to R, add new data to table C,

    table C like this :
    name total
    chong 11
    Lim 4
    Tan 11

    11.30 : Tan login again to web site key in name (data save!)
    11.30 : Server side auto detect new data coming at table A,
    change table A code N to R,add new data to table C,

    table C become:
    name total
    chong 11
    Lim 4
    Tan 11
    Tan 11

    hope can undestand ....

    thank you
    ocm_cm@yahoo.com
     
    ocm1, Nov 20, 2009 IP
  2. ocm1

    ocm1 Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    no body can help?
     
    ocm1, Nov 22, 2009 IP
  3. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #3
    You don't need a third table that is to be updated, you can either run a running total within a seperate field for the most recent addition for each name, e.g:
    Fields:
    Name | Unit | Total | DateEntered (date when new data was entered)

    When a new entry is created add the Unit on to the previous total and store it in the Total field, and store the current date and time (Now) in the DateEntered Field.
    You can then access this by getting the most recent entry:
    sql: "SELECT Total FROM Table WHERE Name = '" & requestedname & "' ORDER BY DateEntered DESC"
    and getting the totel with recordset("Total").
     
    Last edited: Nov 23, 2009
    camjohnson95, Nov 23, 2009 IP
  4. ocm1

    ocm1 Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm sorry, it should be me explain not very well.
    [​IMG]
    [​IMG]
    my proble is how to checking new data coming when client keyin.
    i dont want manual for checking !
    so, can using ajax for realtime detect table A then output to table C?

    remark:
    table A
    R means = read
    N means = new

    thk
     
    ocm1, Nov 26, 2009 IP