Hi all,
I've a Field site
I'm populating this site value using this method from another field selected index changed:
Private Sub Fillsite()
Dim IdtxtSiteInsert As DropDownList = CType(DetailsView3.Rows(0).FindControl("TxtsiteInsert"), DropDownList)
Dim strConn As String = WebConfigurationManager.ConnectionStrings("BMGINC_DYNAX09_ProdConnectionString").ConnectionString
Dim con As New SqlConnection(strConn)
Dim cmd As New SqlCommand()
cmd.Connection = con
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select SiteId, Name from InventSite"
Dim objDs As New DataSet()
Dim dAdapter As New SqlDataAdapter()
dAdapter.SelectCommand = cmd
con.Open()
dAdapter.Fill(objDs)
con.Close()
If objDs.Tables(0).Rows.Count > 0 Then
IdtxtSiteInsert.DataSource = objDs.Tables(0)
IdtxtSiteInsert.DataTextField = "SiteId"
IdtxtSiteInsert.DataValueField = "SiteId"
IdtxtSiteInsert.DataBind()
IdtxtSiteInsert.Items.Insert(0, "-Select-")
Else
LblError.Text = "No Site found"
End If
End Sub
i need to populate the field value same like insert when i click edit in detailview
Thanks in advance
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
sri ranjaniPosted Jul 18, 2018, 7:25 AM