Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 20-08-2009
Member
 
Join Date: Apr 2009
Posts: 65
How to write the form values in Database using C#

How to write the form values in Database using C#, I have a simple form (text fields and pull down menus), I have not keep more customization in my existing form and I want to insert the values from the form into an sql database. This is because i have just now started my ASP.NET classes. Do we need to simply insert the values in the database as we inserted into table or there any specific method to do it.
Reply With Quote
  #2  
Old 20-08-2009
Member
 
Join Date: Feb 2008
Posts: 180
Re: How to write the form values in Database using C#

In your submit button, you have to hook onto an "OnClick" event (in visual studio, double click the button, and it'll create it for you), in there, I managed to get the program to connect to the sql database but how do I set up the insert statement? I have dropdown, radiobuttons and text fields, you can get all the values from your text field and then insert the data into your database using whatever data access method you prefer.
Reply With Quote
  #3  
Old 20-08-2009
Member
 
Join Date: Feb 2009
Posts: 117
Re: How to write the form values in Database using C#

Start by creating a new Windows Application titled Data Form Example. C# does not make use of header files; it uses namespaces to accomplish this purpose. Choose Add Windows Form from the Project menu to display the Add New Item dialog box, click the Data Form Wizard icon, change the name to fclsDataForm.cs Like every Win32 application source, we will start with the inclusion of some header files. The Data Form Wizard is run by adding it to your project as a form template.
Reply With Quote
  #4  
Old 20-08-2009
Member
 
Join Date: Dec 2008
Posts: 128
Re: How to write the form values in Database using C#

Don't you alreay use Request.fomr to retrive this value. Also once you stored these values in application variables they are available from anywhere. You need to defined a connection to the Contacts database, your drop-down list will be empty. Click the New Connection button to display the Data Link Properties dialog box.NOTE that I would put this rather in session as application variables are shared by all sessions and this could result in a problem if multiple users are logging at the same time.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to write the form values in Database using C#"
Thread Thread Starter Forum Replies Last Post
Need C# script to Read and Write Lines over large database Budhil Software Development 2 25-05-2012 04:54 PM
Increasing primary key values in database Aileen_L Software Development 4 06-02-2010 04:28 PM
How to Get the values from the database in ASP? - Empty Shell - Software Development 5 03-02-2010 02:33 AM
Tips of linking the database to form for better the performance in Visual Studio 2010 Candace Tips & Tweaks 1 30-01-2010 03:29 AM
Having asp form with multiple checkboxes to query the database. Broot Software Development 3 09-07-2009 05:12 PM


All times are GMT +5.5. The time now is 12:09 PM.