473,834 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

related to drop down list

13 New Member
sir i have taken to drop down list and i want to select any data in drop down list1,
accordind to this data display related data in drop down list2.
how i can do this i am working in asp.net with c#
the coding i have done is
protected void Page_Load(objec t sender, EventArgs e)
{
strconn = new OleDbConnection ();
strconn.Connect ionString = "Provider=msdao ra.1; user id=payroll; password=payrol l; data source=payroll" ;
strconn.Open();
strsql = "select * from section";
OleDbCommand cmd = new OleDbCommand(st rsql, strconn);
OleDbDataReader reader = cmd.ExecuteRead er();
DdlSectionID.Da taValueField = "SectionID" ;
DdlSectionID.Da taSource = reader;
DdlSectionID.Da taBind();
reader.Close();
strconn.Close() ;

}
protected void DdlSectionID_Se lectedIndexChan ged(object sender, EventArgs e)
{
strconn = new OleDbConnection ();
strconn.Connect ionString = "Provider=msdao ra.1; user id=payroll; password=payrol l; data source=payroll" ;
strconn.Open();
strsql = "select * from Employee where SectionID=" + DdlSectionID.Te xt + " ";
OleDbCommand cmd1 = new OleDbCommand(st rsql, strconn);
OleDbDataReader reader1 = cmd1.ExecuteRea der();
//DdlBillUnit.Dat aValueField = "BillUnit";
DdlBillUnit.Dat aSource = reader1;
DdlBillUnit.Dat aBind();
DdlSectionID.Se lectedIndex = 0;
reader1.Close() ;
strconn.Close() ;
}
were i doing any mistake plz help me
Jun 15 '07 #1
1 981
kenobewan
4,871 Recognized Expert Specialist
I believe you need to change this line:
strsql = "select * from Employee where SectionID='" + DdlSectionID.Te xt + "' ";
Jun 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
6171
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box that appear when user clicks the drop-down arrow button. Because items in the Drop down list are a little long, user can't see the full thing when they pull down the items from the drop down list.
2
12626
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
1
2507
by: pmelanso | last post by:
Hello, I have a drop down list which is dynatically loaded from a database and I have a second drop down list that is also dynatically loaded depending on what is selected in the first drop down box. This all works fine ... what isn't working is when I selected a different item in the first drop down list I want it to automatically reload the items in the second drop down list. I have a funcation called loadNames that laod the second...
8
7582
by: Ed Dror | last post by:
Hi there ASP.NET 2.0 VB & SQL Express Lest take Northwind Categories Products as example I create a table that hold these two together and I create a stored procedure like select ProductID, ProductName, CategoryID, from tblCategoryProducts Where (CategoryID = @CategoryID)
2
1630
by: cpptutor2000 | last post by:
Could some PHP guru please help me? I am creating a dynamic dropdown list using a code snippet(Section A) as below: Section A: $sql_query=mysql_query("SELECT DISTINCT semester, year from schoolproject_pics ORDER BY year DESC"); echo "<select name=\"semester\" onchange=\"GoTo()\">"; echo "<option value=\"$semester\">-Semester Year-</option>"; while($data = mysql_fetch_array($sql_query)){ if($data==@$semester && $data==@$year){
5
18736
by: ashok893 | last post by:
I'm using two drop down list ina form. I have generated the first drop down list from MySQL database. When i select an option from first drop down list, i have to generate second drop down list options by the selected value of first drop down list from MySQL database. For example, the first drop down list contains Animals, Birds... If i select the Animal option, the second drop down list should show like Lion, Tiger.... Both lists should...
4
9302
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me if it works, and if it does not, tell me why it does not work. Thanks.
3
7363
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the document selected (my application uses the BusinessObjects Java Web Services SDK) The 2nd list is dependent on the 1st, while the 3rd list is dependent on the 2nd. In other words, this is what i want my application to do -select a folder from the...
1
1101
by: JohnMV | last post by:
Hi, I have 3 related drop down menus all of which need to be populated from database.In the first list i populated the values from the database. But i have trouble to proceed further. The second has to be populated in based on the value chosen from the first dropdown and the third from the second. I cant use submit button(so cant refresh page) and the second drop down has to be populated.So iam trying to collect the values into an...
0
9799
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9649
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10515
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10554
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10224
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9338
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4428
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3985
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.