hi
i am developing website which is a online shoping
i want to populate two dropdownlist, in which the first dropdownlist should place the list of a paticular product and the next dropdownlist should populate with the models of corresponding product of first dropdownlist1 and the price should be placed on the textbox
please sought out my problem its urgent,my boss kept knife on my throat
thanku in advance
6 4810
Hi peerraghu,
Welcome to TSDN.
When you select an item in the drop down list you can opt for an event handler to be triggered.
Use that to populate the other drop down list.
The evnt handler should be called something like Editvaluechanged. (sorry I have been working with Windows application for a bit too long, forgot the ASP .Net stuff)
Do give our regards to your boss :D
hi
i am developing website which is a online shoping
i want to populate two dropdownlist, in which the first dropdownlist should place the list of a paticular product and the next dropdownlist should populate with the models of corresponding product of first dropdownlist1 and the price should be placed on the textbox
please sought out my problem its urgent,my boss kept knife on my throat
thanku in advance
Hi Raghu,
you can write a query in the SelectedIndexChanged event of the first DropDownList to fill your Second dropdown. I guess this will work.
Hi Raghu,
you can write a query in the SelectedIndexChanged event of the first DropDownList to fill your Second dropdown. I guess this will work.
hi usha thanks for your reply but my problem is
if i select a country from dropdownlist1 then it should give all states of selected country in dropdownlist2 and its capital should be placed in the textboxt box..
but i am getting all list of states of all country,if v select one country..
please sought out my problem
thank you in advance
Hi Raghu,
I think you are following the steps said by Usha and Shashi.
The only reason I can see to your problem is your select query for the state is wrong.You have probably missed the where clause
Hi Raghu,
I think you are following the steps said by Usha and Shashi.
The only reason I can see to your problem is your select query for the state is wrong.You have probably missed the where clause
just explain in detail its urgent
Hi Raghu,
I think you are following the steps said by Usha and Shashi.
The only reason I can see to your problem is your select query for the state is wrong.You have probably missed the where clause
hi mishra
just look at my code where i did mistake - protected void Page_Load(object sender, EventArgs e)
-
{
-
if (Page.IsPostBack == false)
-
{
-
SqlConnection con = new SqlConnection("user id=sa;password=vubrain;database=raghu;data source=vubrain4");
-
SqlDataAdapter da = new SqlDataAdapter("select countyr_id,countryname from country_master", con);
-
DataSet ds1 = new DataSet();
-
da.Fill(ds1, "country_master");
-
dd1.DataSource = ds1.Tables["country_master"];
-
dd1.DataTextField = "countryname";
-
dd1.DataValueField = "countyr_id";
-
dd1.DataBind();
-
}
-
}
-
protected void dd1_SelectedIndexChanged(object sender, EventArgs e)
-
{
-
string countryid;
-
countryid = dd1.SelectedValue;
-
SqlConnection con = new SqlConnection("user id=sa;password=vubrain;database=raghu;data source=vubrain4");
-
SqlDataAdapter da1 = new SqlDataAdapter("SELECT StateID,StateName FROM tblSate_Master S INNER JOIN tblStateCountryRelation SC ON S.StateID=SC.StateId WHERE CountryId='" & countryid & "'");
-
DataSet ds1 = new DataSet();
-
da1.Fill(ds1, "countrystate");
-
dd2.DataSource = ds1.Tables["countrystate"];
-
dd2.DataTextField = "statename";
-
dd2.DataValueField = "stateid";
-
dd2.DataBind();
-
-
-
}
it showing two error report
1.
The best overloaded method match for 'System.Data.SqlClient.SqlDataAdapter.SqlDataAdapt er
2. cannot convert from 'string' to 'System.Data.SqlClient.SqlCommand'
please sought out my mistake
thank you
Sign in to post your reply or Sign up for a free account.
Similar topics
by: kmnotes04 |
last post by:
Is it possible to link one drop-down box to another? For example, if a
name is chosen from a drop-down list, can another drop-down list then
automatically display the person's office as a result of...
|
by: VB Programmer |
last post by:
I have a user control that has a drop down list. Initially it has no items.
The items are loaded into the drop down list in the Page_Load event of the
user control. Basically if...
|
by: Glenn M |
last post by:
whats the easiest way of removing all items ( regardless or their
values) from an asp.net server side dropdown list?
thanks
glenn
|
by: jagdishl |
last post by:
hi
I have to populate the second drop down list based on the selection
made in the previous drop down list.I have to chose between two values
in the first dropdown list i.e city and county.This is...
|
by: bbdobuddy |
last post by:
Hi,
What event do I use when I want to capture the time when the user clicks an
item in a list box or a drop down list. The Selected Index Changed event
isn't working for me.
What I am...
|
by: JamesW |
last post by:
Hi.
VS 2003 (VB.Net)
I want to display data on a webForm based on what the user selects from a
DropDownList.
So, for example, if the user selects customer name from the DDL I want the...
|
by: JenniferG |
last post by:
I've worked with ASP.NET but don't know much about ASP at all. I have the following code. I would like to get a person' birthday and phone number text box populated when the person's name is selected...
|
by: yosri2005 |
last post by:
Hello,
I'm sure many of you have seen the error message in the subject. I
found quiet a few posts on the web regarding this issue, but the ones
I saw mainly tackle this issue when you have a...
|
by: TechnoAtif |
last post by:
HI..
I am looking for php code that will enable me to hide/show a text box based on the users previous drop down list response. If javascript comes into use for it,
its a welcome solution
(1)...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |