•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 374,007 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,882 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 916 | Replies: 17
![]() |
•
•
Join Date: Mar 2008
Posts: 39
Reputation:
Rep Power: 1
Solved Threads: 7
Re: Could someone help me how to add value to A item based on other selected value??(c#)
#11
Mar 14th, 2008
•
•
Join Date: Mar 2008
Posts: 39
Reputation:
Rep Power: 1
Solved Threads: 7
Re: Could someone help me how to add value to A item based on other selected value??(c#)
#12
Mar 14th, 2008
•
•
Join Date: Feb 2008
Posts: 13
Reputation:
Rep Power: 1
Solved Threads: 0
Re: Could someone help me how to add value to A item based on other selected value??(
#13
Mar 17th, 2008
•
•
•
•
Hi,
Do you want to assign ID and Sequence values both to the label depending upon the selection of DropDownLst?
I consider yes.
As i told you in my last post. On DropDownList's selected index change event
you need to do 2 things.
1) fetch ID and Sequence from db depending upon the DropdownLst value
2) Then assign it to your labels.
Hi sbv,
I had problem again, can you show me the code in the step 1??
Thanks
Re: Could someone help me how to add value to A item based on other selected value??(
#14
Mar 17th, 2008
Hi
ok. here it is....
on selected index change of ur dd. write a query llike
SQL="select * from tble where id(pk)=" & dd.selectedvalue
rd = clsComm.GetReader(sql) 'excute query
If rd.Read = True Then
If Not IsDBNull(rd("Sequence")) Then lblSequence.Text = "R-" & rd("Sequence")
'same for other
If rd.IsClosed = False Then rd.Close()
ok. here it is....
on selected index change of ur dd. write a query llike
SQL="select * from tble where id(pk)=" & dd.selectedvalue
rd = clsComm.GetReader(sql) 'excute query
If rd.Read = True Then
If Not IsDBNull(rd("Sequence")) Then lblSequence.Text = "R-" & rd("Sequence")
'same for other
If rd.IsClosed = False Then rd.Close()
Accept Challenges and Enjoy Coding... :)
•
•
Join Date: Feb 2008
Posts: 13
Reputation:
Rep Power: 1
Solved Threads: 0
Re: Could someone help me how to add value to A item based on other selected value??(
#15
Mar 18th, 2008
•
•
•
•
Hi
ok. here it is....
on selected index change of ur dd. write a query llike
SQL="select * from tble where id(pk)=" & dd.selectedvalue
rd = clsComm.GetReader(sql) 'excute query
If rd.Read = True Then
If Not IsDBNull(rd("Sequence")) Then lblSequence.Text = "R-" & rd("Sequence")
'same for other
If rd.IsClosed = False Then rd.Close()
Hi sbv,
this seem not like c# code, can you show in c# !!
Thanks
Re: Could someone help me how to add value to A item based on other selected value??(c#)
#16
Mar 19th, 2008
hi
ur right its a vb.net code
here is c# code.
SQL == "select * from tble where id(pk)=" + dd.selectedvalue
//excute query
rd == clsComm.GetReader(sql)
if (rd.Read == true)
{
if (!Information.IsDBNull(rd("Sequence")))
lblSequence.Text = rd("Sequence");
//same for other
}
if (rd.IsClosed == false)
rd.Close();
ur right its a vb.net code
here is c# code.
SQL == "select * from tble where id(pk)=" + dd.selectedvalue
//excute query
rd == clsComm.GetReader(sql)
if (rd.Read == true)
{
if (!Information.IsDBNull(rd("Sequence")))
lblSequence.Text = rd("Sequence");
//same for other
}
if (rd.IsClosed == false)
rd.Close();
Accept Challenges and Enjoy Coding... :)
Re: Could someone help me how to add value to A item based on other selected value??(c#)
#17
Mar 19th, 2008
i have used code converter here. please verify code.
if u need then here is the link of online code converter
http://labs.developerfusion.co.uk/co...arp-to-vb.aspx
best luck
if u need then here is the link of online code converter
http://labs.developerfusion.co.uk/co...arp-to-vb.aspx
best luck
Accept Challenges and Enjoy Coding... :)
•
•
Join Date: Feb 2008
Posts: 13
Reputation:
Rep Power: 1
Solved Threads: 0
Re: Could someone help me how to add value to A item based on other selected value??(c#)
#18
Mar 19th, 2008
•
•
•
•
hi
ur right its a vb.net code
here is c# code.
SQL == "select * from tble where id(pk)=" + dd.selectedvalue
//excute query
rd == clsComm.GetReader(sql)
if (rd.Read == true)
{
if (!Information.IsDBNull(rd("Sequence")))
lblSequence.Text = rd("Sequence");
//same for other
}
if (rd.IsClosed == false)
rd.Close();
Hi sbv,
Actually my code is something as below:
<asp:TemplateField HeaderText="AREA_BUCKET" SortExpression="AREA_BUCKET">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("AREA_BUCKET") %>'></asp:Label>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="DropDownList_AreaBucket" runat="server" DataSourceID="AreaBucket_SqlDataSource"
DataTextField="AREA_BUCKET" DataValueField="AREA_BUCKET" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
SelectedValue='<%# Bind("AREA_BUCKET") %>' Width="140px" AutoPostBack="true">
</asp:DropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("AREA_BUCKET") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SEQUENCE" SortExpression="SEQUENCE">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("SEQUENCE") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:Label ID="Sequence_label" runat="server" Text='<%# Bind("SEQUENCE") %>'></asp:Label>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("SEQUENCE") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
My code behind is here:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
SQL == "select * from tble where id(pk)=" + dd.selectedvalue
//excute query
rd == clsComm.GetReader(sql)
if (rd.Read == true)
{
if (!Information.IsDBNull(rd("Sequence")))
lblSequence.Text = rd("Sequence");
//same for other
}
if (rd.IsClosed == false)
rd.Close();
}the code behind doesnt work at all
May you help
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
Similar Threads
- Import selected data from .csv and directly import on send_it.asp (ASP)
- Custom Ecommerce (eCommerce)
- Open In New Window Php (PHP)
- add to combobox from listbox in another form (Visual Basic 4 / 5 / 6)
- a Java GUI based program using Swing classes, Vat (Java)
- Want to use radio button or menu bar instead of combo box (Java)
- I've got Trojan.Holax... is this bad? (Viruses, Spyware and other Nasties)
- not-a-virusadware (Viruses, Spyware and other Nasties)
Other Threads in the ASP.NET Forum
- Previous Thread: Log is here. But Code ?? How to get this?
- Next Thread: reading cookie from asp


Linear Mode