Dan

Dan

  • NA
  • 44
  • 0

Creating Custom Forms in Visual Studio (To insert into database)

Mar 12 2008 10:26 AM
Hi guys, I will try and explain this as clearly as I can.

I have setup my SQL statements for INSERT in Visual Studio 2005, and I am using C#.Net as my language.

I can use the built in tools fine to display data and add new records to it. However I want to be able to create my own layout using text boxes and then use a submit button to call the INSERT statement and insert what is included in the text boxes into my database.

I assume I need to name my text boxes the same as they are in the INSERT statement. As an example my insert statement would look something like this:

INSERT INTO [tblUserDetail] (id, name, age) VALUES (@txtid, @txtname, @txtage)

and the name of the 3 text fields would be (txtid, txtname, and txtage)

Now that is setup what code do I need to put in the button to call that INSERT statement that is in my data source?

If you can offer any guidance at all that would be great. I had a search around but could only find people who were having problems with the built in dataview grid etc which I have got working fine.

Answers (1)