try
public class afile
private m_fileID as integer
private m_title as string Public Property FileID() As Integer
Get
Return m_fileID
End Get
Set(ByVal Value As Integer)
m_fileID = Value
End Set
End Property
Public Property Title() As String
Get
Return m_title
End Get
Set(ByVal Value As String)
m_title = Value
End Set
End Property
public Sub New(fileID as integer,title as string)
myBase.New()
me.m_fileID=fileID
me.m_title=title
End Sub
End classSub Page_load
if not ispostback
GetDrop()
end if
End SubSub GetDrop()
Dim connWxciq as SqlConnection
Dim StrSelect as string
Dim cmdSelect as SqlCommand
Dim dtrReader as SqlDataReader
Dim arrFinish as ArrayList
Dim arrUnfinish as ArrayList
connWXCIQ=New SqlConnection("server=localhost;UID=sa;PWD=;Database=pubs")
connWXCIQ.open() strSelect="select * from sales"
cmdSelect=New SqlCommand(strSelect,connWxciq)
dtrReader=CmdSelect.ExecuteReader()
arrFinish=New arraylist
do while dtrReader.read()
arrFinish.add(New afile(dtrReader("stor_id"),dtrReader("payterms")))
Loop
dtrReader.Close()
connWXCIQ.Close()
drpfiles.DataSource=arrFinish
drpfiles.DataTextField = "title"
drpfiles.DataValueField = "fileID"
drpfiles.Databind()connWxciq.close
End sub
public class afile
private m_fileID as integer
private m_title as string Public Property FileID() As Integer
Get
Return m_fileID
End Get
Set(ByVal Value As Integer)
m_fileID = Value
End Set
End Property
Public Property Title() As String
Get
Return m_title
End Get
Set(ByVal Value As String)
m_title = Value
End Set
End Property
public Sub New(fileID as integer,title as string)
myBase.New()
me.m_fileID=fileID
me.m_title=title
End Sub
End classSub Page_load
if not ispostback
GetDrop()
end if
End SubSub GetDrop()
Dim connWxciq as SqlConnection
Dim StrSelect as string
Dim cmdSelect as SqlCommand
Dim dtrReader as SqlDataReader
Dim arrFinish as ArrayList
Dim arrUnfinish as ArrayList
connWXCIQ=New SqlConnection("server=localhost;UID=sa;PWD=;Database=pubs")
connWXCIQ.open() strSelect="select * from sales"
cmdSelect=New SqlCommand(strSelect,connWxciq)
dtrReader=CmdSelect.ExecuteReader()
arrFinish=New arraylist
do while dtrReader.read()
arrFinish.add(New afile(dtrReader("stor_id"),dtrReader("payterms")))
Loop
dtrReader.Close()
connWXCIQ.Close()
drpfiles.DataSource=arrFinish
drpfiles.DataTextField = "title"
drpfiles.DataValueField = "fileID"
drpfiles.Databind()connWxciq.close
End sub
解决方案 »
- 存储过程参数传表名问题! 求救!
- 关于使用urlrewritenet进行页面重定向的一个求助
- 500分悬赏:如何在多台文件服务器之间实现拷贝移动删除文件和文件夹的操作
- 紧急求助,FileUpload控件上传文件出错,找不到文件!
- ASp.net如何可以实现将页面信息保存到客户端机器,以免死机后可以恢复?
- 我的datalist控件中为什么一直是显示九条同样的数据,在线等待
- 怎么根据ip看服务器所存放在的地址???????
- IIS问题
- 如何读出php中的session?
- 一个礼拜都没有回答的问题?关于treeview的控制选择的问题?
- 我只想要本论坛左边的效果如何做呢?
- 在C#中怎样实现多Frame的asp.net程序(在线)
("server=localhost;UID=wxciq;PWD=690103;Database=WXCIQ")
connWXCIQ.open() strSelect="select fileId,title from files"
cmdSelect=New SqlCommand(strSelect,connWxciq)
dtrReader=CmdSelect.ExecuteReader()
arrFinish=New arraylist
do while dtrReader.read()
arrFinish.add(New afile(dtrReader("fileId"),dtrReader("title")))
Loop