选中的下拉列表 [英] dropdownlist in selected

查看:67
本文介绍了选中的下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hai朋友,
我在下拉列表中选择每周写入代码,然后在列表框中显示每周列
但找不到方法

hai friends,
am write code am selected weekly value in dropdownlist, then the weekly column display in the list box
but am can''t find how to do

Protected Sub ddl_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl.SelectedIndexChanged
 
Dim con As New SqlConnection("Data Source=.\SQLEXPRESS;initial catalog=workdb;persist Security info =true;user id=sa;password=vectra")
 
Dim da As New SqlDataAdapter("select weekly from table1 ", con)
 
Dim ds As New DataSet()
 
da.Fill(ds, "d")

If ds.Tables(0).Rows.Count > 0 Then
 
ListBox1.DataSource = ds.Tables(0)
 
ListBox1.DataBind()
 
End If
   
End Sub

推荐答案

我不知道您遇到什么问题.


首先,如果您只希望选择星期记录,请更正您的查询.

i don''t know what problem you are getiing.


First Correct your query I fyou want only selected week records..

"select weekly from table1 where weekly= dd1.selectedValue"



并且如果在选定的索引控件上检查dropDown If的check autoPostBack true属性,则不会转到此代码.



And if The check autoPostBack true property of the dropDown If on selected index control not going to this code.


这篇关于选中的下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆