TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sirisha reddy
NA
1
0
Add records on button click
Nov 8 2009 11:56 PM
Hello Everybody.
I am doing a windows appln in vb.net.
I have a button in my form. When i click the button, textboxes are added dynamically to the form. For 1st click 4 textboxes are added. When clicked again, again the textboxes are added once again...Now i need to save the data from the textboxes to database. Pls anyone help me with that. Here is my coding.
Dim value1 As String = ""
Dim value2 As String = ""
Dim value3 As String = ""
Dim value4 As String = ""
Dim i As Integer
For i = 0 To FlowLayoutPanel1.Controls.Count - 1
Select Case FlowLayoutPanel1.Controls(i).Name
Case "TextBox1"
value1 = FlowLayoutPanel1.Controls(i).Text
Case "TextBox2"
value2 = FlowLayoutPanel1.Controls(i).Text
Case "TextBox3"
value3 = FlowLayoutPanel1.Controls(i).Text
Case "TextBox4"
value4 = FlowLayoutPanel1.Controls(i).Text
End Select
Next i
Dim strsql As String
strsql = "insert into stud values ('" & value1 & "','" & value2 & "','" & value3 & "','" & value4 & "')"
Only the text in the first four textboxes is getting aded to the database.What about the others
Thanks in advance
Reply
Answers (
1
)
Need help with String.Format arguments
need help with regular expressions