Help getting data into database

S

scurenton

First off - New to Programming.

Problem: I created an aspx page with x amount of text boxes. These
text boxes can be filled by the user and when they click the submit
button I want the data in each box to be inserted in database fields
that they relate to. I created a database and a table with the same
amount of cols as I have textboxes. Company_Name textbox data should
go into the Company_Name field I have in SQL Database and so forth.
What is the best way or better yet - how do I get this textbox data
into my database. I've tried searching for answers but down to hope
now. Any help and/or examples would be greatly appreciated. Once I
can get this working, I'm sure I'll have more questions.
 
H

Hermit Dave

you need to first learn how to use insert statements...
insert statement essentially insert data into the database table.

once you are done with that... use ado.net to connect to the database
and then do an insert using ado.net

what i would say is get yourself a nice book and start gently... no need to
rush bout... its very simple...

--
Regards,

HD

Once a Geek.... Always a Geek

Once a Geek... Always a Geek
scurenton said:
First off - New to Programming.

Problem: I created an aspx page with x amount of text boxes. These
text boxes can be filled by the user and when they click the submit
button I want the data in each box to be inserted in database fields
that they relate to. I created a database and a table with the same
amount of cols as I have textboxes. Company_Name textbox data should
go into the Company_Name field I have in SQL Database and so forth.
What is the best way or better yet - how do I get this textbox data
into my database. I've tried searching for answers but down to hope
now. Any help and/or examples would be greatly appreciated. Once I
can get this working, I'm sure I'll have more questions.
 
D

Dune

Very roughly...what you want is...for each textbox, pull
out it's value, then, using ADO .NET, connect to your
database, then, using a sql statement, insert the value
you pulled out into your database.

You can pull out the value from each textbox by using the
Text property of each textbox.

e.g.
Dim name As String = NameTextBox.Text

To do the rest of what you want, you must know about sql
(the language used to interact with the database) and
about ADO .NET (used to get your .NET code talking to the
database).

Here's the online documentation for ADO .NET:

http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpguide/html/cpconAccessingDataWithADONET.asp

Here's the online documentation for transact sql
(specifically, for the INSERT statement):

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/tsqlref/ts_ia-iz_5cl0.asp

Watch out for line breaks when you copy-and-paste the
links above.



Hope this helps some
 
S

scurenton

Thanks for pointing me in the right directions. Went back to work and
drilled into ADO.NET and SQL for a while. I created a Stored
Procedure in SQL and Called it in my .NET app using a connection
string, SqlCommand, and InsertData string = to "EXEC StoredProc '"
& textbox.text & "',"'...... Anyway, ran the program and
worked great. Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top