![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
~*Ashley Star*~
Join Date: Mar 2008
Posts: 1
Rep Power: 0
![]() |
Hello there,
I am in need of trying to figure out what is the best way to send data submitted from a form online to a database. I have a webform that will be submitting user requests, and when the information is submitted I would like it to be inserted into my Request Database. Right now the only things I have on my form are as follows: User ID [ txtUserID ] User Email [ txtUserEmailAddress ] Request [ txtRequestSummary ] Would this require me to use any type of stored procedures? This will be an on going website and I would like to set it up where it can be 'easy maintanence' if the database needed fixing/updating etc. I would appreciate your help! Thank you so much ![]() Also the database name is called "Database" Using MS Server 2003 Using C# as the language in Visual Studio Last edited by ahlaj77; Mar 18th, 2008 at 10:31 AM. |
|
|
|
|
|
#2 |
|
Hmmmm ... Is there more??
Join Date: Apr 2008
Location: Post Falls, ID
Posts: 15
Rep Power: 0
![]() |
Re: Need help sending information from an ASP.NET form to a database
I thought I could help until I saw this...
I have a fairly extensive set of ASP programs which update a SQL database. The database is resident on the same server that provides the ASP pages. Nevertheless, we established a DSN so that the connection would be smooth - which is okay in this application because the entire thing runs on a trusted network - no outside access. (You may not want to do it this way... I'm not sure.) In the programs I have - first you define a string to contain your SQL command - using variables, this might look something like this: vb Syntax (Toggle Plain Text)
Maybe you can translate this VB to C# for your use - if this doesn't really answer the question .. let us know ... ![]()
__________________
Ken - New to PFO ... but been dabbling in various versions of BASIC since highschool - circa 1973. "Shouldn't the 'Air and Space' museum be empty?" - Dennis Miller Last edited by opa6x57; Apr 7th, 2008 at 9:13 AM. Reason: typo in original |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Nov 2007
Posts: 86
Rep Power: 1
![]() |
Re: Need help sending information from an ASP.NET form to a database
opa6x57: if i entered X'; into the form field column1.value, i would have just trashed your entire database. it is not smart to use anything other than constants in your sql commands. you should use parameters to take care of escaping form input and making the sql safe to execute.
ahlaj77: there is a book called programming asp.net from orielly which would cover this topic in detail. there are probably plenty of other tutorials for free on the web. if you find one and want to be sure it is good, post it here and i can glance at it and let you know. this is a pretty large topic, and i wont write an entire chapter in this post when it has already been written somewhere else. |
|
|
|
|
|
#4 | |
|
Hmmmm ... Is there more??
Join Date: Apr 2008
Location: Post Falls, ID
Posts: 15
Rep Power: 0
![]() |
Re: Need help sending information from an ASP.NET form to a database
Quote:
(Most of the inputs are radio buttons and check boxes - which force input to be a certain value. The ones that aren't have code to strip unwelcome characters and format the input to match the database template.) I appreciate the feed back - since I inherited this site with the code as-is. (I'm a VB programmer from before .NET so some of this SQL stuff is quite new.) I'd appreciate a little more detail on your comment, "use parameters to take care of escaping form input" ... can you give me an example?
__________________
Ken - New to PFO ... but been dabbling in various versions of BASIC since highschool - circa 1973. "Shouldn't the 'Air and Space' museum be empty?" - Dennis Miller |
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Nov 2007
Posts: 86
Rep Power: 1
![]() |
Re: Need help sending information from an ASP.NET form to a database
first, radio buttons and combo boxes do not force the input to be anything. if you connect to the http port with telnet you can type whatever you want as a value for that field.
i do not know what is available in asp. in asp.net (more specifically ado.net) this example might help: http://www.csharp-station.com/Tutori.../Lesson06.aspx i just realized that this is c#, but you can probably find one that is in vb |
|
|
|
|
|
#6 | ||
|
Hmmmm ... Is there more??
Join Date: Apr 2008
Location: Post Falls, ID
Posts: 15
Rep Power: 0
![]() |
Re: Need help sending information from an ASP.NET form to a database
Quote:
Regardless - a determined cracker could mess with this data - I agree. Quote:
How would one implement such an optional update using parameters?
__________________
Ken - New to PFO ... but been dabbling in various versions of BASIC since highschool - circa 1973. "Shouldn't the 'Air and Space' museum be empty?" - Dennis Miller |
||
|
|
|
|
|
#7 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8
![]() |
Re: Need help sending information from an ASP.NET form to a database
I have an extension called Firefox called Web Developer. One of its features is the ability to turn drop-down boxes into text fields to test against this very vulnerability. However, turning check boxes and option buttons into text fields doesn't make sense, as you don't check the value, you check to find out whether the button ID was sent or not, and it's therefore hack-proof (assuming you get everything else right).
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do you cache information taken from a form? | Haseloff | JavaScript and Client-Side Browser Scripting | 2 | Feb 17th, 2007 6:18 AM |
| Obtaining information from an Access Database in VB | Argosax | Visual Basic .NET | 1 | Jan 14th, 2006 12:16 PM |
| Hiw to verify form information | bulio | PHP | 3 | Jul 12th, 2005 9:21 AM |
| Sending a web form as parameter | see07 | C# | 4 | Mar 24th, 2005 9:25 PM |