用数据表构造一个ArrayList然后绑定到dropdownlist上,我一般都是这么做的。
解决方案 »
- 关于AJAX.NET程序上传到服务器的问题
- 关于SQLDATASOURCE 高级应用!
- 小分题~~~关于数据存入时间被绑定显示出来的问题
- 急!怎样在Asp.net中实现IE全屏.(在*.apsx中用c#脚本实现)
- 百分求教
- 上面的文字左右移动 把123的名字 按照一天一换 怎么做
- 怎样在没有声明的情况下访问PlaceHolder控件的多个RadioButtonList子控件的属性和方法?
- Datagrid可以实现这样的分页:跳到XX页 首页 上一页 下一页 尾页 吗?
- 关于dropdownlist的问题
- 判断有无文件,File.Exists()。是对当前目录,还是整个网站?如果要判断一指定目录,如何写?
- 关于DataGrid的显示问题
- Span1.InnerHtml=Select1.Value + "," +select1.? ;
DropMoneyType.DataSource = dd.GetPayTypeInfo();
DropMoneyType.DataTextField = "paytype";
DropMoneyType.DataValueField = "id";
DropMoneyType.DataBind();
Dim MyCommand As New System.Data.SqlClient.SqlCommand(strSQL, MyConnection)
MyConnection.Open()
Dim DR As System.Data.SqlClient.SqlDataReader
DR = MyCommand.ExecuteReader()
Dim objTemp As New DropDownList
objTemp = ControlName
While DR.Read()
Dim tempList As New ListItem
tempList.Text = DR("content")
tempList.Value = DR("code")
objTemp.Items.Add(tempList)
tempList = Nothing
End While
objTemp = Nothing
DR.Close()
DR = Nothing
MyCommand = Nothing
MyConnection.Close()
MyConnection = Nothing
Dim MyAdp As New SqlClient.SqlDataAdapter("selct * from table", MyConn)
Dim MyDr As New DataSet
MyAdp.Fill(MyDr, "111")
Drop1.DataSource = MyDr42
Drop1.DataTextField = "string"
Drop1.DataValueField = "id"
Drop1.DataBind() 执行时却提示:"未将对象引用设置到对象的实例"!是否是界面前台哪里还需要什么?