-----
Protected Sub DropDownList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList2.SelectedIndexChanged
Using conn As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnString2").ConnectionString)
Dim cmd As New Data.SqlClient.SqlCommand("GetColAColB", conn)
cmd.CommandType = Data.CommandType.StoredProcedure
conn.Open()
cmd.Parameters.Add("@X", Data.SqlDbType.VarChar)
Dim da As New Data.SqlClient.SqlDataAdapter(cmd)
Dim ds As New Data.DataSet
da.Fill(ds)
If (ds.Rows.Count > 0) Then
Textbox1.Text = ds.Rows(0)("ColA").ToString();
TextBox2.Text = ds.Rows(0)("ColB").ToString();
End If
conn.Close()
End Using
End Sub
|