Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Adding data to a table from another form

$
0
0

I recently started a thread here : http://social.msdn.microsoft.com/Forums/en-US/7aac295c-c685-43f1-a898-13978cd7be00/editing-data-on-a-table-from-a-different-form-in-c?forum=winforms

 And someone answered, but I'm still unsuccessful. I have followed the steps (to my best understanding) and I can't get form2 to function properly.

What I'm aiming to do is add data to a table from another form (to make it more user friendly). In a nut shell, on form1 you can view a table with a buttons saying "Add new contact". When clicked it opens form2 with texts boxes that the user enters manually, then clicks a button called "Save", the table is then updated, form2 exits returning back to form1 with the new entry visible in the table.

I have noticed that when you go to enter data to the table(or datagridview) you have to click the plus icon before it allows you to type, which means doing the same on form2 to allow you to type anything, can this be avoided and just allows you to type straight away?

I'd also like to add error messages if a text box has been left blank, how can I achieve this?

I am using winforms in Visual C# 2010 (Express) and using local SQL databases to create the tables etc.

Please try to be as descriptive as possible, I'm still a beginner!


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>