Connecting Tech Pros Worldwide Forums | Help | Site Map

Help getting data into database

scurenton
Guest
 
Posts: n/a
#1: Nov 18 '05
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.


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Hermit Dave
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Help getting data into database


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" <curentoc@bellsouth-dot-net.no-spam.invalid> wrote in message
news:400498e0$1_2@Usenet.com...[color=blue]
> 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.
>
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com[/color]


Dune
Guest
 
Posts: n/a
#3: Nov 18 '05

re: Help getting data into database


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
[color=blue]
>-----Original Message-----
>First off - New to Programming.
>
>Problem: I created an aspx page with x amount of text[/color]
boxes. These[color=blue]
>text boxes can be filled by the user and when they click[/color]
the submit[color=blue]
>button I want the data in each box to be inserted in[/color]
database fields[color=blue]
>that they relate to. I created a database and a table[/color]
with the same[color=blue]
>amount of cols as I have textboxes. Company_Name textbox[/color]
data should[color=blue]
>go into the Company_Name field I have in SQL Database and[/color]
so forth.[color=blue]
>What is the best way or better yet - how do I get this[/color]
textbox data[color=blue]
>into my database. I've tried searching for answers but[/color]
down to hope[color=blue]
>now. Any help and/or examples would be greatly[/color]
appreciated. Once I[color=blue]
>can get this working, I'm sure I'll have more questions.
>
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
>----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
>----------------------------------------------------------[/color]
[color=blue]
> http://www.usenet.com
>.
>[/color]
scurenton
Guest
 
Posts: n/a
#4: Nov 18 '05

re: Help getting data into database


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


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
scurenton
Guest
 
Posts: n/a
#5: Nov 18 '05

re: Help getting data into database


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


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Closed Thread