Question Form needs to appear blank and ready for entry

BelkoBondi

New member
Joined
Aug 10, 2015
Messages
2
Programming Experience
10+
Hello!
I am a new member of this forum and a C# newbie who is currently building a data entry form that I need to be able to only take in new data and write it to a backed SQL Server database. I don't want previous data that has been entered to be displayed. I have a form built and connected to the database but the form comes up displaying the first record from the table it will be writing to. Is there a setting or a way that I can be connected to that table and display the fileds for that table empty and ready for new entry?
Please forgive the simple nature of this question but I have spent a good deal of time trying to figure this out on my own and could not find a question in the forum of a similar nature. Any help or guidance provided would be greatly appreciated!
BB
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
1,183
Location
Norway
Programming Experience
10+
BindingSource.AddNew method should probably be what you look for.
 

BelkoBondi

New member
Joined
Aug 10, 2015
Messages
2
Programming Experience
10+
Eureka! Added it to the form load and I'm on a new record when I start the app. Now if I can just figure out how to make the existing records read-only....I'll be all set! Thank you very much!
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
1,183
Location
Norway
Programming Experience
10+
Now if I can just figure out how to make the existing records read-only....
One suggestion I found was to use for example DataGridView.CellClick event, where you conditionally set the rows ReadOnly property, for example based on the rows IsNewRow property.
 
Top Bottom