Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Add records to sql sever database through asp.net website - visual studio 2008

Posted on 2013-11-11
3
Medium Priority
?
400 Views
Last Modified: 2013-11-13
I'm using Visual Studio 2008 and firstly create asp.net website. I can connect to the information in SQL Server database using dataview or gridview and can query a particular entry (ie. Eqipment Id. -brings up all details linking to that Equipment).
I can then edit the details of that Equipment and this would update the SQL Server Db.
What I need to do is to have a form that simply enters new details for a new Equipment. ie. Enter Equipment Name:   [__] Enter Serial Number: [__]. Then for this to update the database. By using the gridview or dataview I am able to view all fields that exist in the table and edit them. Is there a way that I can get a blank gridview/dataview template (which includes all the fields in the table) and fill it out to then update the database?
0
Comment
Question by:cookiejar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 80

Expert Comment

by:arnold
ID: 39640719
Your asp app needs to have a form with the fields.
Your existing code needs to be modified to display a blank form rather than query the database and then populate the data in the response.
0
 

Author Comment

by:cookiejar
ID: 39645089
Could you direct me to a good tutorial that will show me how to do this?
0
 
LVL 80

Accepted Solution

by:
arnold earned 2000 total points
ID: 39645994
Without understanding what you currently have, I am guessing based on what you posted.

It sounds that your current rendering is based on a query into the database and then building out the form to present to the user.
One way to maintain this and get what you want is to query such that you do not get any valid responses but only have the fields.

The tool you are using to consrtuct these presumably has an empty form

<form action=processdata.aspx>
<input name=column>
<input type=submit
</FORM


http://www.w3schools.com/aspnet/aspnet_forms.asp has
Look for any ASP.net guide.  There are many sites on the web that provide access to the books that provide introduction/examples of constructing.
make sure to take into account that your current code suggests that it is likely open to SQL injection.  Deals with whether the data you receive from the web site, is being directly pumped into the sql server such that a well placed ' could terminate the execution of your sql query and then will process the directives that follow that well placed (').
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question