Question:
How can I get my website to show reservations info to customer?
Petros
2013-02-26 03:10:33 UTC
Hello guys,

I am building a small website in ASP.NET that includes a database with customers, tables and reservations.
What I want to do is this.

After the customer has completed the reservations form and presses the "Reserve" button that I have, I want the website to show to the customer all info related to his reservation. Like a query that will read directly from the database reservations table.

How can I get the website to show those stuff AFTER the customer has pressed the reserve button?

Thank you so much if you can help me!
Three answers:
Jack
2013-02-26 04:16:45 UTC
Fred has a point in that, "If you need to ask, you probably shouldn't be doing it".



However, I think he's gone a bit OTT. Especially about the 80% of sites on the net are PHP and mySQL based, because that's simply, wildly, untrue. If someone tells you a percentage, and doesn't give a trustworthy source, then it's just a number they've picked out of thin air. Also, you didn't mention anything about logging in, passwords or financial transfers. Nor did you say that you were hosting an HTTP web server yourself. Security; in terms of having your account hacked and used to host bank phishing sites, etc., will be handled by whoever your web host is. If they notice anything dodgy going on, they'll block your site, because THEY'RE liable for their own servers. You're liable too in some respects, but they're ultimately responsible for what they host.



ASP is also part of the .NET framework. It's _incredibly_ popular, and supremely powerful, especially when combined with MS SQL Server 20xx. More so than PHP because of the support for the .NET framework and associated languages.



That's all a little off-topic though.





I'm afraid no one will be able to assist you with this as you haven't mentioned which type of SQL database you're using (as the syntax for queries differs slightly between them) and we know nothing about your table(s) structure(s) (things like field names, data types, relationships, etc.)



What you need to ultimately do is write a basic SQL SELECT statement - http://www.w3schools.com/sql/sql_select.asp - to find the users specific data from your database back-end, and then display it in suitable controls on your "Booked!" (or whatever) page, which is loaded when the user clicks the "Reserve" button.



I assume you'll also want some logical and database checks to ensure that your not able to double book the same table. I know it's not much to go on, but hopefully it's a nudge in the right direction.





Hope this helps!

.
?
2013-02-26 11:21:53 UTC
If you need to ask this you should NOT be building a public access site for people logging in and definitely not for taking any kind of reservation fees or similar. First asp is not a good method, and depending on the database back end you may be causing your self serious trouble later. Considering 80 % of sites on the Internet use php and the mysql database, and most public servers will not accept any other database, and others will not allow asp, you will be in trouble if you ever need to move your hosting. also php and mysql have inbuilt functions for validating the data entered and preventing bad data from forcing script attacks on you site. This can let a hacker take over your server and run a background bank phishing scam site from it or WORSE. It also compromises your customer's personal data and banking or credit card details. You would be liable for their losses. And you really need to study for about 6 months if you can not work out how to make a submit button display a page of data.
soulfulfunk
2013-02-28 12:13:21 UTC
Jack is pretty much spot on with his comments - I have no idea what Fred is talking about, to contradict him, .net is actually seen as more secure than php and it's pretty much 50/50 of websites that use it but let's leave that irrelevant debate.



why don't you just do a response.redirect after the data has been entered, and on the next page drag in a gridview with your sql command something like



select * from (table name) where userid = label1.text



in your code behind: label1.text = Membership.GetUser.ProviderUserKey.ToString()


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...