C
Cederstrom
Hello,
I just started to learn ASP.NET, and I am using MySQL for database, I have a
question I hope someone can answer for me though
I want to create a simple form that can edit and create a row in a database,
for example the fields Name and Lastname. How do I go about this, can I
somehow link my TextBox's to a field in the MySql database? So when I press
Create-Button it adds the row with the fields from TextBox's itself?
Or must I make a Button_Click event and make the SQL myself there?
If I must do it myself, in PHP I used to create forms so all TextBox's were
part of an array, then I could easilly make a foreach and create the SQL
statement on the fly. This way I could add another TextBox to the page (and
in the database ofcause), and not have to go change my code for it to be
saved.
Im looking for the best solution to creating/updating on a webform... and
for my example a webform with 2 TextBox's (Name and Lastname) and 2 Buttons
(Update and Create) would be good example, so I can use that method on
bigger forms.
I hope someone can point me in the right direction.
Thanks,
Cederstrom
I just started to learn ASP.NET, and I am using MySQL for database, I have a
question I hope someone can answer for me though

I want to create a simple form that can edit and create a row in a database,
for example the fields Name and Lastname. How do I go about this, can I
somehow link my TextBox's to a field in the MySql database? So when I press
Create-Button it adds the row with the fields from TextBox's itself?
Or must I make a Button_Click event and make the SQL myself there?
If I must do it myself, in PHP I used to create forms so all TextBox's were
part of an array, then I could easilly make a foreach and create the SQL
statement on the fly. This way I could add another TextBox to the page (and
in the database ofcause), and not have to go change my code for it to be
saved.
Im looking for the best solution to creating/updating on a webform... and
for my example a webform with 2 TextBox's (Name and Lastname) and 2 Buttons
(Update and Create) would be good example, so I can use that method on
bigger forms.
I hope someone can point me in the right direction.
Thanks,
Cederstrom