Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 08, 2012 02:00 AM by bhaskar.mule
May 06, 2012 11:52 AM|LINK
well I read I can databind so I dun have to use the db more than the initial binding.
BUT I am not sure how to use this binding.
For the first item I can use a simple sql.
But the other item is written by numbers and what I want to represent is the item which this number represents-how do I do that?
This is what I currently have (excluding the using sql connection....and other lines)
cmd.CommandText = "SELECT subject_name,subject_parent FROM Subject";
SqlDataReader reader = cmd.ExecuteReader();
DropDownList1.DataSource = reader;
DropDownList1.DataTextField = "subject_name";
DropDownList1.DataValueField = "";
The problem is my last line here.
I need to place the subject parent's name (subject parent is an id-int field) I need to search the id and insert the name isntead.
I don;t think I can add anotehr sql exectution after the "="....
So basically my question is how do I excute an sql here
select subject_name FROM subject WHERE subject_id=subject_parent .
EDIT:I figured I misunderstood the whole thing.
What I wanna do is different than the droplist purpose and must b done differently.
May 08, 2012 01:53 AM|LINK
If you have solved your question you may share your answers. Then other people who comes accross the same problem can refer to it.
May 08, 2012 02:00 AM|LINK
i hope it will help you