Adding a new row to table in a windows forms application.
Posted on 2011-03-08
I'm starting to use Visual Studio to create a Windows Forms application. I've just started.
I'm using C#. Visual Studio 2010.
I used Delphi since version 1, and I feel a bit lost... no, totally lost, regarding to all data access related in Visual Studio.
In Delphi, for adding a record I used to call MyTable.Insert(), which would clear the content of my TDBEdit's controls, the fill them with data and a button with a MyTable.Post(); to save the data.
Well, that's mean that only two lines of code are required to insert a new record in a table with Delphi.
In Visual Studio, I have no idea, but I'm guessing is not that simple.
So, the first thing I want to do, is to "emulate" this Delphi behavior.
I have my text controls already bound, and they show the first row in my table (in Sql), I added a button with a "New" caption, which I want to clear the current row data to allow entry for new data.
How do I do that? :(