|
-
Mar 17th, 2018, 09:28 PM
#4
Re: How to insert textbox on button click and save data in all the textboxes in db VB
Then why is it limited to 9? I've heard that there is a limit on how many close friends we can have, but still, it seems like your number might go over 9.
You might consider a FlowLayoutPanel rather than the TableLayoutPanel, and just allowing the number to grow as needed. Another alternative would make working with a database even easier, but it would look totally different, so you might not find it suitable. That other alternative would be to use a DataGridView tied to a Datatable. You'd still be able to add items, and they'd end up in a datatable, which would be easier to use for interacting with a database. In fact, even if you prefer the layout panel you have, you might find it easiest to then put the items into a datatable:
Code:
Dim myTable as New Datatable
myTable.Columns.Add("GiveTheColumnANameHere",GetType(String))
Then you can add rows pretty easily:
Code:
Dim nr As DataRow=myTable.NewRow
myTable.Rows.Add(nr)
They the datatable could write to a database table pretty easily. However, this isn't a great design. After all, there's no checking for duplicates, or anything of the sort. Still, there is plenty of information about reading/writing a datatable to a database, so it would get you closer as a general design.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|