C#.Net ASP (Urgent)
-
Hi, I have a question. I have a comobox, i've bind data something like this oleDbDataAdapter1.Fill(dataSet11); DropDownList1.DataSource = dataSet11.Tables[0].DefaultView; DropDownList1.DataTextField = dataSet11.tbacdes.ac_headColumn.ToString(); //Display AC Head DropDownList1.DataValueField = dataSet11.tbacdes.ac_idColumn.ToString(); // Display AC Id DropDownList1.DataBind(); first of all is correct. Now I want to to show Account Header in comobox and when user select any value than selectindex pass header id this my question, please help me out init. Example ======= [Student Fee] Display value and in backend of this entry in comobox header id is 2 I'm using asp.net 1.1, C#.Net.
|Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com
-
Hi, I have a question. I have a comobox, i've bind data something like this oleDbDataAdapter1.Fill(dataSet11); DropDownList1.DataSource = dataSet11.Tables[0].DefaultView; DropDownList1.DataTextField = dataSet11.tbacdes.ac_headColumn.ToString(); //Display AC Head DropDownList1.DataValueField = dataSet11.tbacdes.ac_idColumn.ToString(); // Display AC Id DropDownList1.DataBind(); first of all is correct. Now I want to to show Account Header in comobox and when user select any value than selectindex pass header id this my question, please help me out init. Example ======= [Student Fee] Display value and in backend of this entry in comobox header id is 2 I'm using asp.net 1.1, C#.Net.
|Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com
-
Hi, I have a question. I have a comobox, i've bind data something like this oleDbDataAdapter1.Fill(dataSet11); DropDownList1.DataSource = dataSet11.Tables[0].DefaultView; DropDownList1.DataTextField = dataSet11.tbacdes.ac_headColumn.ToString(); //Display AC Head DropDownList1.DataValueField = dataSet11.tbacdes.ac_idColumn.ToString(); // Display AC Id DropDownList1.DataBind(); first of all is correct. Now I want to to show Account Header in comobox and when user select any value than selectindex pass header id this my question, please help me out init. Example ======= [Student Fee] Display value and in backend of this entry in comobox header id is 2 I'm using asp.net 1.1, C#.Net.
|Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com
| Muhammad Waqas Butt | wrote:
C#.Net ASP (Urgent)
OK, that really doesn't tell us much, except that you couldn't find the ASP.NET forum, and you're impatient.
| Muhammad Waqas Butt | wrote:
DropDownList1.DataBind();
1 - please give your variables real names. I am astounded how many people post code here and have not set meaningful variable names 2 - do this only on the first call ( check for !IsPostback ), otherwise, your selected index will be lost on postback 3 - handle the SelectedIndexChanged event, then the form will postback when you change the selection ( or add a button so users have to select to do this ) and then in there, check the SelectedValue property, use int.TryParse to get it as a number, if it's a number, and do whatever database calls, etc you want with it from there.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
| Muhammad Waqas Butt | wrote:
C#.Net ASP (Urgent)
OK, that really doesn't tell us much, except that you couldn't find the ASP.NET forum, and you're impatient.
| Muhammad Waqas Butt | wrote:
DropDownList1.DataBind();
1 - please give your variables real names. I am astounded how many people post code here and have not set meaningful variable names 2 - do this only on the first call ( check for !IsPostback ), otherwise, your selected index will be lost on postback 3 - handle the SelectedIndexChanged event, then the form will postback when you change the selection ( or add a button so users have to select to do this ) and then in there, check the SelectedValue property, use int.TryParse to get it as a number, if it's a number, and do whatever database calls, etc you want with it from there.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Christian Graus wrote:
| Muhammad Waqas Butt | wrote: DropDownList1.DataBind(); 1 - please give your variables real names. I am astounded how many people post code here and have not set meaningful variable names
Yes, this is one of my peeves. People that do this can have loads of fun debugging when they have multiple forms with more than one DropDownList1 in their project if they do so.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus