hi every one . when my form gets load it automatically fills th data using these two line

Me.CustomerTableAdapter.Fill(Me.NewBookingDataSet1.Customer)             "Customer info is displayed in text boxes on same form"

Me.BookingTableAdapter.Fill(Me.NewBookingDataSet1.Booking)               "Booking is displayed in data gridview"

when i use the the above two lines as comment then i get the empty form which i want. But problem is i have to click on plus(+) sign on binding navigator to get the fields and datagridview ready to enter the new record. when i click on (+) it gives me the next incremented id, i want to generate the id bu using click of a button. i dont want to use the plus sign. I want to have a button Add new booking. when i click there i get all fields and booking gridview ready to enter new records.

Recommended Answers

All 3 Replies

i cant get your point , but for getting id , you can get the max id by using datareader and then +1 and show it to your textbox.it is very simple.now can you please little bit explain your point. do you want to create whole form consisting of textboxes , grid dynamically ? or something else?

And regarding the use of the [+] button.
Can't you change the label to say "Add new booking" instead of a [+] sign?

i am talking about the plus sign on binding navigator to insert a new record.which automatically generates the next id from database and shows in the textbox. i want the same functionalioty but using a code under button. because of these two lines

Me.CustomerTableAdapter.Fill(Me.NewBookingDataSet1.Customer) "Customer info is displayed in text boxes on same form"
Me.BookingTableAdapter.Fill(Me.NewBookingDataSet1.Booking) "Booking is displayed in data gridview"

my text fields automatically filled when forms get loaded . i dont want to show any thing when the form gets loaded. instead i want my textboxes and datagridview to be shown empty to insert new records.
at the moment i can only get my form ready by clicking the add button on binding navigator.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.