| | |
Help with Databinding
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Yes, sorry to say but you are not being very clear in what you are wanting to do.
Have you successfully connected to the SQL Server DB?
You can use a Container to the specific Value you want to associate with the LABEL Object.
Below is a sample to this code:
Hope this helps!
Have you successfully connected to the SQL Server DB?
You can use a Container to the specific Value you want to associate with the LABEL Object.
Below is a sample to this code:
<asp:Label id="label1" runat="server" Text='<%# Container.DataItem("CustomerName") %>
Hope this helps!
•
•
Join Date: Jun 2005
Posts: 4
Reputation:
Solved Threads: 0
So, would you use it like this:
I am pretty sure I am way off.
ASP.NET Syntax (Toggle Plain Text)
<tr><td colspan="2"><hr color="#F53167" width="100%" size="3"></td></tr> <tr><td colspan="2"> <form id="form1" runat="server"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:tcmConnectionString1 %>" SelectCommand="SELECT * FROM [prod]"> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:tcmConnectionString1 %>" SelectCommand="SELECT [prod_description] FROM [prod] WHERE ([ID] = @ID)"> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" Name="ID" PropertyName="SelectedValue" Type="Int64" /> </SelectParameters> </asp:SqlDataSource> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="prod_name" DataValueField="ID"> </asp:DropDownList><br /> <asp:Label ID="Label1" runat="server" Text='<%# SQLDataSource2.DataItem("prod_description") %>'></asp:Label> </form></td></tr> </table>
I am pretty sure I am way off.
![]() |
Similar Threads
- Databinding in JSP (JSP)
- Databinding not updating object properties (C#)
- [Databinding] (VB.NET)
- DataBinding (C#)
- Working with SQL's Text data type (ASP.NET)
- Adding a checkbox column dynamically (C#)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Use of Image control on Web Page
- Next Thread: Type ' ' Not Defined
Views: 11933 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax alltypeofvideos anathor application asp asp.net bc30451 bottomasp.net browser button c# checkbox click commonfunctions confirmationcodegeneration connection css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist edit editing expose feedback flash form formatdecimal forms formview google grid gridview hosting iframe iis javascript jquery list listbox login microsoft migration mono mouse mssql multistepregistration news numerical object objects panelmasterpagebuttoncontrols parent problem project radio reportemail richtextbox rotatepage save schoolproject search security services session silverlight smartcard software sql sql-server sqlserver2005 suse textbox theft tracking unauthorized update validation vb.net video videos view virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice youareanotmemberofthedebuggerusers






