how can I input and display the data via the database quickly? - asp.net

I have a webpage in which users input some data and that data is supposed to be stored in the database and then at the same moment should be displayed in the display section.
I have a very trivial question please. How can I take the result from the database to be displayed the same moment the user inputs it in the database? Is it like something cronjob, which checks the database every second that the new results have been input or not?
e.g. I have a registration form to register the properties in a property webpage. if a user submits a form to my database, how can I keep checking whether the database is updated or not? The users would expect their property listing to be displayed on the webpage within a second

Related

Magnolia detail subapp commit action

I'm on magnolia 6.2.15 and I need to generate data from some fields that users insert in a content detail subapp.
I thought about creating a subclass of magnolia "SaveDetailSubAppAction", in the "execute" method to do the job.
I can retrieve fields value but, how can I generate new fields data values and insert that in the form before validation and commit to jcr datasource?
Well you can't. Or rather you shouldn't. The form is means for user to enter the data. If you create data programatically, you either send it directly to the datasource or store it directly on the node that datasource operates on.
If you want to show generated data to user for approval prior saving, then you need to create custom field that would have the place for extra input and would react on user generated input directly prior to saving content.

How to create a form where user gives details and also can check what he has entered on wordpress

I want to create a form on wordpress where the user will give the response and then the response is stored as csv , my problem is that i am using weforms and user are able to fill the form and response is stored also but i am not able to display the entries made by that user to himself so that he can change or view his entries later on also . I have made a website using buddy press where i need to take some data in the form so that the data is stored and the user can also check what he has entered and other members can also view his entries by going on his profile

asp.net 1.1 duplicated submission entries

I've got an old framework 1.1 project with the following problem: if user submits a page then in database duplicated records might appear. This error repeats often but is not consistent: in most cases there are no duplicated entries but in some cases there can be upto 4 of them. We disable submit button with JavaScript after first submission.
May be this would be helpful: there is a session object used to store user inputs (which are submitted).
Any scenarios you can think of why duplicated records can happen?
Many thanks
Finally I found that some mobile browsers ignored JavaScript that disabled submission button and users managed to resubmit form multiple times.
The easiest (?) solution to this is the following:
Create a table "SubmissionTokens" in database with two fields: Token (uniqueidentifier), DateCreated (DateTime). Then, when page with submission form loads, add a token to database and save "id" value in a hidden field on the same page. When user submits the form then read token from the hidden field and see if token exists in table SubmissionTokens. If it does exist then insert a new record with form data in the database and delete the token from SubmissionTokens. You can also use DateCreate field to expire tokens.
At work I implemented a bit different solution and just look for duplicated records in the database before inserting a new record. But this is because there is a specific requirement that user must be able to resubmit form if he clicks "back" in browser. In this case the SubmissionToken is already deleted and the first solution wouldn't work.

send a mail to a user with a link

In my project i am sending a mail to the user to create a user account. I want to enable that link for the first time he/she clicks the link. if he clicks the link for more than 2 times,then it should go to custom error page.how to do this?
This depends on how the link is generated.
For example: If your link contains a username as GET-parameter, then you could simply query your database if the username is already in use. I would advise against that, because the user can easily change that GET-Parameter
I would recommend this: Your link should contain a unique identifier, most likly a hash. This hash is stored somewhere, to garantee it's uniqueness, like in the usertable of your database (a column for the hash of the registration link). That might also come handy, because you could create new user rows and already prefill them with necessary information. You could use these information upon rendering to insert text into the textboxes

Open a form from an InfoPath form with values from the first to the new

I have been working with InfoPath forms for the last two months or so, and I now have the following requirement:
I have a form which is filled in by certain users, then sent to other users. The latter, after viewing the data on the form, have the possibility to either Accept & Reply or Reject.
When they click on Accept & Reply, another form is triggered, in which some of the fields are repeated. I would like to know how to get the values from the first form to that triggered form.
Let me precise that I am not using SharePoint; they are accessing the forms from a shared folder on the LAN.
Thanks in advance for your help on this.
Yusuf
That I know of you can't directly access the new form since Infopath keeps all instances separate (SDI vs MDI). You need a "middle" storage location. A database isn't a bad idea if you have one available - when the user clicks the button, data is saved to the DB, then the new form is opened and reads from the DB on form load.
Another way we have used (which is equally as cumbersome), is to use a blank copy of the form itself (not the original xsn). It is bad because you have to manually keep the blank copy up to date if you change the template but works well for what you are doing. Only recommended if you REALLY need those fields populated and you don't have a DB you can use for temp storage.
Open your form template like you are going to fill in the form but just save a "blank" copy to the share (it will save as xml). The process behind the button on your source form is: create a unique copy of the blank form (we store them all in a subfolder that gets cleaned out nightly), programmatically open and edit that new blank copy (easy since it is xml) putting data in the correct fields, save the edited copy, open the edited copy for the user instead of the xsn.

Resources