Click here to Skip to main content
12,950,618 members (57,873 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a database in which a table has name "Registration" which is used to register the user.
It has only two column one is "Username" and one is "password".
A page named "Register.aspx" is used for registering the member which have two textbox one is for taking Username(textbox1) and one is for taking password(textbox2) and one button for insert these value in database.
The Main problem is that we cannot write statement like this :

Insert into Registration (Username, password) values     ('TextBox1.text','TextBox2.text')

I am using Connection oriented mode , i googled but i didnt find any way to insert row in SQL database in connected mode. Please provide me a idea for inserting this row?
Posted 30-Dec-12 2:11am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Have a look at: SqlCommand.Parameters[^] - the example shows how to perform the operations - including the use of parameters to pass values to the server.

You could also have a look at: C# Station ADO.NET Tutorial[^]

Best regards
Espen Harlinn
__TR__ 30-Dec-12 11:07am
My 5!
Espen Harlinn 31-Dec-12 7:06am
Thank you, TR

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,984
CHill60 3,460
Maciej Los 3,053
Jochen Arndt 1,975
ppolymorphe 1,820

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 30 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100