问题描述
所有人都高兴
我正在数据库中的vb.net中做一个项目,我有5个不同的标题.
以下编码用于数据库检索数据库数据.
(< pre lang ="vb">尝试
conopen()
cmd =新的SqlCommand(&从PRO_DETAILS中选择PROJECT_TITLE",con)
ada =新的SqlDataAdapter(cmd)
ds = New DataSet()
ada.Fill(ds)
昏暗的我,作为整数
a = ds.Tables(0).Rows.Count
对于i = 0到a-1
rw = ds.Tables(0).Rows(i)
ComboDDtitle.Items.Add(rw(&"PROJECT_TITLE& quot;).ToString())
下一个
异常捕获
MsgBox(& quot; Error& quot;)
结束Try</pre>
)
但它最多可以运行五次,但是我只想运行一次并显示在组合框中,即可选择特定的标题.
在此先感谢,
Rajeshkumar
Hai to all
I am doing a project in vb.net in my database i have 5 different titles .
the following coding are used for database retrieving the database datas.
(<pre lang="vb">Try
conopen()
cmd = New SqlCommand("select PROJECT_TITLE from PRO_DETAILS ", con)
ada = New SqlDataAdapter(cmd)
ds = New DataSet()
ada.Fill(ds)
Dim i, a As Integer
a = ds.Tables(0).Rows.Count
For i = 0 To a - 1
rw = ds.Tables(0).Rows(i)
ComboDDtitle.Items.Add(rw("PROJECT_TITLE").ToString())
Next
Catch ex As Exception
MsgBox("Error")
End Try</pre>
)
but it running the count up to five times ,but i want only one time run it and displayed in the combobox for choosing a particular title.
Thanks in Advance,
Rajeshkumar
推荐答案
这篇关于使用vb.net编码时显示数据库详细信息的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!