dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Handling data with Ajax

  1. #1
    Join Date
    Sep 2008
    Posts
    1

    Handling data with Ajax

    I am building one billing application in asp.net which will be used in intranet. I dont want to add the items of bill one by one. Instead of that I want when i click button, one window shoul open with coloumns like item, rate, qty total. Item should have combo box from which I wil select item and rate will get automatically displayed. when I add number of items, I will just click one button and all data will go to the database in one shot. Is it possible using AJAX.
    REMEMBER I WANT ONLY SINGLE TRIP TO THE SERVER NOT MULTIPLE

    pLEASE HELP ME...

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Welcome to DevX

    Is all the data stored in the same table?

    If so, then yes, one SQL INSERT statement should do it.

    However, if you need to add/update records in multiple tables, then you will probably need multiple server trips.

  3. #3
    Join Date
    Mar 2007
    Location
    Bangalore, India
    Posts
    247
    AJAX is only a communication method. If you design your app to remember state (which is not done through AJAX, but you could use JavaScript), you can use AJAX for communication. But even AJAX won't be required, you can collect the data using JavaScript and Cookies(not recommended unless you are using a session and multiple server / client communications) or other methods, and then submit the form using a normal POST communication. In anyways, the simple answer is yes, it is possible.

    Hack, I think a single server trip will do for multiple tables too. Because the webserver needs to get the data only once. I don't think he's talking about communication between webserver and database server. That is a complicated issue.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    You are right, this is a bit complicated.

    If we are not talking about communicating between the webserver and the database server, then what are we talking about?

  5. #5
    Join Date
    Mar 2007
    Location
    Bangalore, India
    Posts
    247
    I think he wants some kind of billing system where he enters the items, rate, quantity etc in a page, and when he clicks something like a submit button, all of the data entered is submitted at once. Basically he wants a JavaScript application rather than an application where you add one item, that goes to the server, and the server returns a new page containing a list of already added items and provision to add more items.

    Ajax is for client (browser) - webserver communication only anyways.

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Quote Originally Posted by Razee Marikar
    I think he wants some kind of billing system where he enters the items, rate, quantity etc in a page, and when he clicks something like a submit button, all of the data entered is submitted at once.
    That could easily be accomplished by running a single SQL INSERT INTO query.

Similar Threads

  1. Why does AJAX cache data?
    By khaled_288 in forum AJAX
    Replies: 3
    Last Post: 03-28-2007, 10:10 AM
  2. Create multiple data in data report
    By helme_syahiemie in forum VB Classic
    Replies: 1
    Last Post: 04-06-2006, 08:39 PM
  3. Turbo Data: test data generator (www.turbodata.ca)
    By Peter Prager (Canam Software) in forum vb.announcements
    Replies: 0
    Last Post: 08-15-2001, 10:48 AM
  4. Data Junction Announces XML Junction 7.51
    By Tim Frost in forum xml.announcements
    Replies: 0
    Last Post: 04-02-2001, 10:53 AM
  5. DataGrid - Enter data in a cell at run time
    By William Gaddam in forum VB Classic
    Replies: 1
    Last Post: 05-02-2000, 09:19 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center