none
Stock Ticker Querry for server side RRS feed

  • Question

  • I am developing a stock ticker with a html marquee tag in ASP.NET 2.0.

     

    The stocks quotes are stored in a table called tbl_StockData. If i assume that the tbl_StockData is updated or a new row is inserted after every 1 minute then what caching technique i should be using at server side. At client side i have set a timer that will raise a callback event and gets those only quotes that are updated/changed in that 1 minute.

     

    As the quotes are updated very oftenly ,What all precautions i have to use to improve the performance ?

     

    i am confused what to use . i have read about sql cache dependany, object caching, partial caching , but what to use here i am not able to decide.  

     

    Please help.

    Thanks in advance,

    regards,

    mmk.

    Thursday, November 22, 2007 5:57 AM

Answers

  • according to my view

    1) you will have to get the insertion time of row.

    for this you will have to make a datatime column that will insert datetime value default

    like this

    add column TableName dInsertionTime DateTime NOT NULL DEFAULT GetDate()

    Now Your SecondStep

    when ever you will fire any Query against DataBase,after this you will have set CurrentDate in a Hidden Field

    like this

    DataSet ds=execute query.....

    hdnLastAccessTime.value=DateTime.Now.Tostring();//SetLast AccessTime

    for further accessing record you have to specify thia LastAccess Time in your condition or Where clause

    select ColumnName ... from TableName Where dInsertionTime >(CAST(hdnLastAccessTime.value AS DateTime))

     now every time you will have to set LastAccessTime in Hidden Field this may Occor either in PostBack or ClientCallBack.

    if you are using ClientCallBack then You will have to add CuuentTime on result.

    like this.

    string sData;

    string GetCallBackResult()

    {

    data+="?"+DateTime.Now.Tosting();//? is dilimitor by which you will extract LastAccessTime Value

    }

    void RaisCallBackEvent(string argg,string arg2)

    {

    data="Any Processing ,,,,";

     

    }

     

     

    every time you will have to pass LastAssceeTime when you will call ClientCallBack Function.

    Friday, November 23, 2007 5:25 AM