User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Mar 2008
Posts: 39
Reputation: srikanthkadem is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
srikanthkadem srikanthkadem is offline Offline
Light Poster

Re: Could someone help me how to add value to A item based on other selected value??(c#)

  #11  
Mar 14th, 2008
Reply With Quote  
Join Date: Mar 2008
Posts: 39
Reputation: srikanthkadem is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
srikanthkadem srikanthkadem is offline Offline
Light Poster

Re: Could someone help me how to add value to A item based on other selected value??(c#)

  #12  
Mar 14th, 2008
:
Reply With Quote  
Join Date: Feb 2008
Posts: 13
Reputation: hwa is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
hwa hwa is offline Offline
Newbie Poster

Re: Could someone help me how to add value to A item based on other selected value??(

  #13  
Mar 17th, 2008
Originally Posted by sbv View Post
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
Reply With Quote  
Join Date: Jan 2008
Location: India
Posts: 141
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

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()
Accept Challenges and Enjoy Coding... :)
Reply With Quote  
Join Date: Feb 2008
Posts: 13
Reputation: hwa is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
hwa hwa is offline Offline
Newbie Poster

Help Re: Could someone help me how to add value to A item based on other selected value??(

  #15  
Mar 18th, 2008
Originally Posted by sbv View Post
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
Reply With Quote  
Join Date: Jan 2008
Location: India
Posts: 141
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

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();
Accept Challenges and Enjoy Coding... :)
Reply With Quote  
Join Date: Jan 2008
Location: India
Posts: 141
Reputation: sbv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

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
Accept Challenges and Enjoy Coding... :)
Reply With Quote  
Join Date: Feb 2008
Posts: 13
Reputation: hwa is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
hwa hwa is offline Offline
Newbie Poster

Help Re: Could someone help me how to add value to A item based on other selected value??(c#)

  #18  
Mar 19th, 2008
Originally Posted by sbv View Post
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>&nbsp;&nbsp;
                            
                    </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>
                        &nbsp;&nbsp;
                        <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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 10:39 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC