Query">
Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Bind a DropdownList
Author:
Vimal Lakhera
E-mail:
Click to e-mail author
Website:
http://geocities.com/vimallakhera
Submitted:
9/24/2005
Version:
ASP.NET 1.1
Compatibility:
ASP.NET 1.0, ASP.NET 1.1
Category:
Databases
Views:
18309
/// This function is used to bind a DropdownList /// ///
Query to get DropDown value ///
Text to be displayed ///
Value Part of dropdown ///
DropdownList Name Code is in C#.
Declarations:
'none
Code:
public void bindList(string SQLstring,string TextField, string ValueField, System.Web.UI.WebControls.DropDownList DropList) { try { DropList.DataSource=getDataset(SQLstring); DropList.DataTextField = TextField; DropList.DataValueField = ValueField; DropList.DataBind(); } catch(Exception e) { HttpContext.Current.Response.Write(e.Message.ToString()); } }
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement