Jump to content
startuga

[Resolvido] DropDownList

Recommended Posts

startuga

Boa tarde,

Eu tenho este código.

 Dim con As New SqlConnection("Data Source=xxxxxxx\xxxxx;Initial Catalog=xxxx;User ID=xxxx;pwd=xxxx")
	 con.Open()
	 Dim command As New SqlCommand("UPDATE AREAS SET AREA_ID = @AREA_ID, AREA_CODE = @AREA_CODE, AREA_DESC = @AREA_DESC WHERE (AREA_ID = @AREA_ID)", con)
	 command.Parameters.Add("@AREA_ID", SqlDbType.VarChar).Value = TextBox1.Text
	 command.Parameters.Add("@AREA_CODE", SqlDbType.VarChar).Value = TextBox2.Text
	 command.Parameters.Add("@AREA_DESC", SqlDbType.VarChar).Value = TextBox3.Text
	 command.ExecuteNonQuery()
	 con.Close()
End Sub

<asp:HyperLinkField DataNavigateUrlFields="AREA_ID,AREA_CODE,AREA_DESC" DataNavigateUrlFormatString = "Edit.aspx?AREA_ID={0}&AREA_CODE={1}&AREA_DESC={2}" Text="Edit/Delete" />

If Not IsPostBack Then
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
	 Dim strID As String = Request.QueryString("AREA_ID")
	 Dim strCode As String = Request.QueryString("AREA_CODE")
	 Dim strDesc As String = Request.QueryString("AREA_DESC")
	 TextBox1.Text = strID
	 TextBox2.Text = strCode
	 TextBox3.Text = strDesc
End If
End Sub

Se quiser populacionar uma dropdownlist como faço?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.