查看: 629|回复: 4
|
有关ASP.NET C#
[复制链接]
|
|
Dim row as DataRow
For Each row In ds.Tables(0).Rows;
dropdown.Items.Add(row(0).ToString());
Next
***************************************
以上要如何CONVERT去C#呢???
谁能帮帮我??? |
|
|
|
|
|
|
|
楼主 |
发表于 6-2-2006 10:55 AM
|
显示全部楼层
Public Sub dropdown(ByVal dropdown As DropDownList, ByVal strSelect As String, ByVal connection_type As Integer, Optional ByVal SelectedIndex As Integer = 0)
Dim ds As New DataSet()
Dim row As DataRow
Dim dbfuncs As New DB_Funcs()
ds.Dispose()
ds = dbfuncs.fillDataSet(strSelect, connection_type)
For Each row In ds.Tables(0).Rows
dropdown.Items.Add(row(0).ToString())
Next
dropdown.SelectedIndex = SelectedIndex
End Sub
还是谁能帮我CONVERT这整个FUNCTION去C#? |
|
|
|
|
|
|
|
发表于 7-2-2006 01:12 AM
|
显示全部楼层
原帖由 Lan_Evo 于 6-2-2006 10:55 AM 发表
Public Sub dropdown(ByVal dropdown As DropDownList, ByVal strSelect As String, ByVal connection_type As Integer, Optional ByVal SelectedIndex As Integer = 0)
Dim ds As New DataSet()
...
public void dropdown(DropDownList dropdown, string strSelect, int connection_type, int SelectedIndex)
{
DataSet ds = new DataSet();
DataRow row;
DB_Funcs dbfuncs = new DB_Funcs();
ds.Dispose();
ds = dbfuncs.fillDataSet(strSelect, connection_type);
foreach (int row in ds.Tables(0).Rows) {
dropdown.Items.Add(row(0).ToString());
}
dropdown.SelectedIndex = SelectedIndex;
}
多多上网找就有啦..
看这边:
developerfusion |
|
|
|
|
|
|
|
楼主 |
发表于 7-2-2006 09:45 AM
|
显示全部楼层
oh, 谢谢你 我只懂得VB.NET的SYNTAX
现在新的公司要用C#,所以有点还不习惯... |
|
|
|
|
|
|
|
发表于 12-2-2006 08:22 AM
|
显示全部楼层
我以前也用vb.net,现在要在一个C#.net 的系统里加两个module,我头很痛。 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|