Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
fldtype fldDesc fldname fldparam fldid

1 First Applicant txtFirstApp @txtFirstApp 1
1 Second Applicant txtSecondApp @txtSecondApp 2
1 Third Applicant txtThirdApp @txtThirdApp 3
1 PAN No txtPAN @txtPAN 4
1 J.H1 Pan No. txtJh1Pan @txtJh1Pan 5
2 Bank Name cboBankName @cboBankName 23
2 Bank A/c Type cboBankAcType @cboBankAcType 24
1 Bank A/c No txtBankAccNo @txtBankAccNo 25
1 Bank Add1 txtBankAdd1 @txtBankAdd1 26
1 Bank PIN txtBankPin @txtBankPin 30
1 Bank State txtBankState @txtBankState 31
2 Mode of Red. cboModeofRedemption @cboMode 32
1 IFSC Code txtIFSC @txtIFSC 33


based on fldtype we are create dynamically textboxes and dropdownlist.

in a dynamic textbox text how to store insert a value into sqldb

VB
If ds1.Tables(0).Rows(i)(0).ToString() = "1" Then

                       Dim lbl1 As New Label()
                       lbl1.ID = "lbl1" + i.ToString()
                       lbl1.Text = ds1.Tables(0).Rows(i)(1).ToString()
                       lbl1.Text = lbl1.Text + ":" + "       "
                       myDiv.Controls.Add(lbl1)

                       Dim MyTextBox As New TextBox()
                       MyTextBox.ID = ds1.Tables(0).Rows(i)(0).ToString()
                       myDiv.Controls.Add(MyTextBox)

                       'table = table & "<tr><td>" + ds1.Tables(0).Rows(i)(1).ToString() + "</td><td>" + MyTextBox.ID + "</td><td>"
                       myDiv.Controls.Add(New LiteralControl("<br />"))
                       'table = table + "</table>"
                       'myDiv.InnerHtml = table
                       div1.Attributes.Add("class", "button")
                   End If

                   If ds1.Tables(0).Rows(i)(0).ToString()= "2" Then

                       Dim lbl2 As New Label()
                       lbl2.ID = "lbl2" + i.ToString()
                       lbl2.Text = ds1.Tables(0).Rows(i)(1).ToString()
                       lbl2.Text = lbl2.Text + ":" + "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"
                       myDiv.Controls.Add(lbl2)


                       Dim ddl As New DropDownList()

                       ddl.AutoPostBack = True
                       'ddl.Height = "27px"
                       'ddl.Width = "130px"
                       ddl.ID = ds1.Tables(0).Rows(i)(0).ToString()
                       ddl.DataSource = ds1.Tables(0).Rows(i)(0).ToString()
                       ddl.DataBind()

                       myDiv.Controls.Add(ddl)
                       myDiv.Controls.Add(New LiteralControl("<br />"))

                       div1.Attributes.Add("class", "button")

                   End If



Dim txtUserName As TextBox = DirectCast(pnlInfo.FindControl(ds1.Tables(0).Rows(i)(0).ToString()), TextBox)

how to add all textboxes text values into db.

plz help me...
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900