Results 1 to 10 of 14

Hybrid View

  1. #1
    Senior Member
    Join Date
    Jan 2011
    Location
    Navi Mumbai
    Posts
    30

    Question

    Thanks for your reply Dario, this is code which i am using for retrieve the updated value, which i have written in ExternalFeedProducer class.

    Code:
    public void ComputeNewValues() {
                lock (this) {
                    try
                    {
                        conn = new SqlConnection("Data Source=(local);Database=TestDB;Integrated Security=true;");
    
                        comm = new SqlCommand("Select TotalQuantity, UnitPrice from Products WHERE ProductID=" + _productID + ";", conn);
                        conn.Open();
    
                        SqlDataReader dr = comm.ExecuteReader();
                        while (dr.Read())
                        {
                            int totQty = Convert.ToInt32(dr[0]);
                            double unitP = Convert.ToDouble(dr[1]);
                            if (_totalQuantity != totQty)
                                _totalQuantity = totQty;
                            if (_unitPrice != unitP)
                                _unitPrice = unitP;
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message.ToString());
                    }
                    finally
                    {
                        conn.Close();
                    }
                }
            }
    Actually i have a table in SQL SERVER with multiple records [say 10 records with multiple columns], when i run the DataAdapter class in INIT method i am retrieving all the records from SQL SERVER and storing in DataTable.

    Now the DataTable contains 10records stored internally, when i called the webclient i am getting all the records displayed in the page [total 10 records are displaying].

    If i change any value in the DataBase [SQL SERVER table], its reflecting in the web client. My code work perfectly for only those records which is retrieved in INIT method when i run the DataAdapter. BUT if i add extra record into the database SQL SERVER [say i have added 11th record], now my table record count will be 11 instead of 10 and in my webclient its already showing 10records.

    My Issue: when i add new record in db it should also reflect/show in the webclient, that mean whenever any new record is added in DB that should be reflected in my PAGE.

    If i restart DataAdapter and access my webpage then its showing 11 records, instead of restarting dataadapter to check the updated record my dataadapter should automatically check if any new records is added in the database if added then it should display in my web page.

    Hope you got the point what exactly i need. If you want more clarification then let me know i will explain with code and screen shots

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    If you need that all your DB table is shown on the screen, then you also need a variable-size table on the screen too.
    Please, see our Basic Portfolio Demo, where you can have lines added or removed by buying or selling stocks.

    Is this a case similar to yours?
    The demo leverages the COMMAND mode for items (a single item is needed for the whole table) and a DynaMetapushTable to display tabular data on the page.
    This demo may be a better starting point for your use case.
    However, the demo Data Adapter is not based on an external database,
    so all the adapting work from database queries to the updates in COMMAND mode has to be made from scratch.
    We can provide you with hints, if needed.

  3. #3
    Senior Member
    Join Date
    Jan 2011
    Location
    Navi Mumbai
    Posts
    30
    Thankyou Dario, Out requirement matches similarly with BASIC PORTFOLIO DEMO.
    Your Valuable Hints are always welcome DARIO.

    let me know how to use these two [COMMAND mode, DynaMetapushTable ].

    Suggestion: if you include samples in HELP file for each method & Property [how to use it] in java are any language [it could be not complete code but 3 to 4 lines of code is also enough to understand] then it could help the programmer to easily understand where exactly he has to use the method and how to use it instead of posting in forum and waiting for reply, and that too it will reduce burden for both, for replying/ clarifying doubts raised/posted by the developer in forum.

    its just a suggestion from my side.

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    We chose to provide suggestions on how to use the various API methods through complete yet short examples.
    This is because most methods have to be used in combination with others and it would be difficult for us to clarify the correct context (or the various possible contexts) for each call in a few lines of code.
    Could you point us to a public API documentation that you feel as exemplary?

    In your case, you have now identified the Basic Portfolio Demo as a starting point and you should now analyze the demo code
    to see how data is transferred from the Data Adapter through the Server to the client page
    and how the client uses a DynaMetapushTable to display the data.
    Then you can refer to the documentation of DynaMetapushTable for the usage details, though for the example usage you have to stick to the demo.
    You can also find a general introduction to COMMAND mode in the DOCS-SDKs/General Concepts.pdf document, particularly in paragraph 3.1
    For any further aspects that have to be clarified, we are available via forum.

    I remind you that, once you have grasped the logics of the COMMAND mode, you can no longer take advantage of the provided demo,
    as adapting code from a DB table to COMMAND mode has to be written from scratch.
    We may provide you with pseudocode, if needed.

  5. #5
    Senior Member
    Join Date
    Jan 2011
    Location
    Navi Mumbai
    Posts
    30

    Arrow

    Thank you for responding Dario. I am very much satisfied with the support how you people are giving,

    check the below link how they provided help with example's [ABCPdf7 doc],
    http://www.websupergoo.com/helppdf7net/default.html

    I am not saying that we have create full example for each method, but we can use single example where most of the method are used and divide that example and link it to those method which are used in the example.

    Its just a suggestion to make your product more helpful to users and less burden on support team.

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    Thank you for the suggestion.
    Though I could find method-related examples only for the "Doc" class,
    it is a big piece of work, that cannot be replicated in short time.
    We could try to keep that into consideration.

    Referring to full code snippets from inside a javadoc may not be easy.
    A simple cross-reference can be found in the examples introduction page.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:53 AM.