| | |
DropDownList
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2006
Posts: 62
Reputation:
Solved Threads: 0
hi,
sorgu = New SqlCommand("SELECT name, surname, age FROM veriler WHERE name=@name", database)
sorgu.Parameters.AddWithValue("@name", DropDownList1.Text)
name surname and age are rows in one of columns. i cant add them into the DropDownList.
DropDownList2.DataSource = kisiler
DropDownList2.DataTextField = "name"
DropDownList2.DataTextField = "surname"
DropDownList2.DataTextField = "age"
DropDownList2.DataBind()
this line add only "age". i want it to add all.
thank you
sorgu = New SqlCommand("SELECT name, surname, age FROM veriler WHERE name=@name", database)
sorgu.Parameters.AddWithValue("@name", DropDownList1.Text)
name surname and age are rows in one of columns. i cant add them into the DropDownList.
DropDownList2.DataSource = kisiler
DropDownList2.DataTextField = "name"
DropDownList2.DataTextField = "surname"
DropDownList2.DataTextField = "age"
DropDownList2.DataBind()
this line add only "age". i want it to add all.
thank you
I guess ...
Dropdownlist could have only one text datafield.
Your sql command have 3 columns in one row not one column
name | surname | age
first line you put the value in field name in datatextfield
second line you put the value in field surname in datatextfield
and the last you put the value in field age in datatextfield
so your field age show in dropdownlist
^^
Dropdownlist could have only one text datafield.
Your sql command have 3 columns in one row not one column
name | surname | age
ASP.NET Syntax (Toggle Plain Text)
sorgu = New SqlCommand("SELECT name, surname, age FROM veriler WHERE name=@name", database)
ASP.NET Syntax (Toggle Plain Text)
DropDownList2.DataSource = kisiler DropDownList2.DataTextField = "name" DropDownList2.DataTextField = "surname" DropDownList2.DataTextField = "age" DropDownList2.DataBind()
first line you put the value in field name in datatextfield
second line you put the value in field surname in datatextfield
and the last you put the value in field age in datatextfield
so your field age show in dropdownlist
^^
![]() |
Similar Threads
- dropdownlist value doesnt get selected (ASP)
- GetSelectedIndex Datagrid? Dropdownlist (ASP.NET)
- disable dropdownlist with javascript (JavaScript / DHTML / AJAX)
- Help with dropdownlist data adding? (VB.NET)
- DataGrid: Edit mode, the index of a dropdownlist does not start at the right Value (ASP.NET)
- GetSelectedIndex Datagrid? Dropdownlist (C#)
- How do I save an index to a particular index of a dropdownlist in a datagrid. (C#)
- Help With Datagrid RE: Creating and Saving DropDownList ReportsToID (C#)
Other Threads in the ASP.NET Forum
- Previous Thread: How to connect sql database in asp.net using VB?
- Next Thread: please help
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form gridview gudi iis image javascript list listbox maps menu mobile mouse mssql nameisnotdeclared news novell opera order parent problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security select serializesmo.table sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview typeof validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xsl





