.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

#BIND two seperate data items into one label

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
Hey people!I have a simple question.. but for the life of me cannot figure it out. I have two fields in my database (firstname and lastname)I have a formview, and I filter the results and I get two labels - one with firstname and one with lastname. I want to put the FIRSTNAME and LASTNAME together in one label but I am stuck lol. <asp:label id="label1" runat="server" SkinID="profilepropertylabel" Text='<%BIND ("Firstname") & BIND("Lastname") %>' />It only gives me the last name when I do that. Help?

View Complete Post

More Related Resource Links

SQL Server 2005: Jazz Up Your Data Using Custom Report Items In SQL Server Reporting Services


Custom report items in SQL Server 2005 Reporting Services address your needs for custom reports without the pain of doing it from scratch.

Teo Lachev

MSDN Magazine October 2006

.NET Reflection: Dynamically Bind Your Data Layer to Stored Procedures and SQL Commands Using .NET M


One major inconvenience of using SQL stored procedures from code is having to match type information. You have to write long wrapper functions around the procedures just to expose the data types. In the .NET Framework, however, the reflection services of the System.Reflection namespace allow you to query rich metadata that describe data types. This article explains how to use reflection in .NET to end your stored procedure nightmares. The author creates four custom classes, including one that generates a SQLCommand object based on the metadata of a method. Using this library, you'll be on your way to automating the generation of stored procedures.

Atif Aziz

MSDN Magazine August 2002

Change data on gridview bind


Hi there,

Simple little problem. i have a gridview that shows products assigned to a customers job. They are displayed in exVAT prices. To make it easier i want to show the inc VAT prices. How can i add VAT to 1 column in this table?

Access and Bind data wihtout using Datasource Control


i want to bind my gridview with a dataset with concept of caching (to minimize the database server trips). plz give me a best example to get and bind data to gridview (command line) . grid paging is also enabled so example code should be capable to rebind data at Gridview page change.  

Sharepoint list group by column data ,display in webcontrol like panel or label


I  have a sharepoint list[Managers] with groupby sector column. like below




Each Sector group by column data i want to display in label or panel control.

How to do that ? how to write the logic?



Regards, Mansoor

RSACrytoService Provider decrypt each element with seperate key gives Bad Data

I have spent about two days. Here is my code: XmlDocument xmlDoc = new XmlDocument(); xmlDoc.PreserveWhitespace = true; xmlDoc.Load("C:\\test.xml"); CspParameters cspParams = new CspParameters(); cspParams.KeyContainerName = "XML_ENC_RSA_KEY"; RSACryptoServiceProvider rsaKey = new RSACryptoServiceProvider(cspParams); CspParameters cspParams2 = new CspParameters(); cspParams2.KeyContainerName = "XML_ENC_RSA_KEY2"; RSACryptoServiceProvider rsaKey2 = new RSACryptoServiceProvider(cspParams2); Encrypt(xmlDoc, "creditcard", "EncryptedElement1", rsaKey, "rsaKey"); Encrypt(xmlDoc, "personal", "EncryptedElement2", rsaKey2, "rsaKey"); This works gerat. Now I want to decrypt the 'creditcard' and 'personal' data elements seperately with 'rsakey' and 'rsakey2' . If do this I get Bad Data error public static void Decrypt(XmlDocument Doc, RSA Alg, string KeyName) { EncryptedXml exml = new EncryptedXml(Doc); exml.AddKeyNameMapping(KeyName, Alg); exml.DecryptDocument(); } This gives bad data since the file has been encrypted with two different keys. So I tried something like this. But I don't know how to decrypt each data element seperately.  Can someone please help? public static void DecryptElement(string ElementToEncrypt, RSA Alg, string KeyName) {

Show Calendar Control SQL data value using Label control

Hi, I have a Calendar Control which is getting certain dates from SQL database and shows them in gray colour using following SQL statements: protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { DateTime nextDate; if (dShows != null) { foreach (DataRow dr in dShows.Tables[0].Rows) { nextDate = (DateTime)dr["Date"]; if (nextDate == e.Day.Date) { e.Cell.BackColor = System.Drawing.Color.DarkGray; } } }  SELECT Count(Mytable.ID), Mytable.Date,MAX(Location.SLocation) as Location FROM Mytable INNER JOIN Location ON Mytable.Sh_ID=Location.Sh_ID GROUP BY Mytable.Date Everything works fine but I want to Show Location and Date also under the calendar control usnig Label control so when user clicks highlighted date it shows Date and Location (only the ones which are coming from SQL database and are highlighted) using Label control. Thank you.      

Bind hierarchical data

Our system holds a DB table which stores catalogue records and catalogue items. The structure is heirarchical so catergory items can be children of category items in the same table, the catalogues are records with parentid = null; My question is if I populate one combox for the catalogues, how can I now bind my catalogue items combobox to the parents' children. Is this possible in XAML rather than code? Cheers Cheers

I need a suggestion to bind the data in share point 2010 page.Suggest some right control to do this.

In my visual web part i need a control to display rows with grouping option. In my web part i am going to display all my document library and  announcement so that i need groping option. I need to do grouping option in the view.so what is the best control u suggest me to bind my data? 

Assembly items don't show in SSIS Data Flow

I successfully add a new assembly (MapPoint Batch Geocoder.dll) into GAC using Mscorcfg.msc and I can see it from the assembly list and I've added the dll into SSIS's PipelineComponents folder but for some reason I just cannot see it from SSIS Data Flow Item tab, I saw some others have the similar issue, and I actually tried to fix it based on their solutions such as change the framework version, but nothing changed. I am using VS2008, .NET 3.5 framework. I don't understand how come I can see it from GAC and also can see it through .NET tab in "Add References" but just not from Data Flow Item tab? Any ideas? Thanks a lot!


the database result is as follows DATE     code   class1 class2  class3 1/8/10     M1     10       20     30     3/8/10     V2      20       30     10      1/8/10      H1      1           2      3         7/8/10     ! ! 8/8/10     !M2    5      5      5       3/8/10     B2      4      4     4       1/8/10     V1      3      7     3       THE OUTPUT SHOULD BE AS FOLLOWS:- DATE           M1                          M2           

Bind SQL Data to a RadioButtonList

 Hi all, I need to bind data from an SQL Select Statement into a RadioButtonList and have not been able to come up with anything that works. <asp:Table runat="server" ID="TableTitle" Width="800px" CssClass="Table" Style="margin-top: 20px;"> <asp:TableHeaderRow runat="server"> <asp:TableHeaderCell runat="server" Font-Size="Medium" HorizontalAlign="Center" ColumnSpan="2">Title</asp:TableHeaderCell> </asp:TableHeaderRow> <%--Exam Questions--%> <asp:TableRow runat="server"> <asp:TableCell runat="server" HorizontalAlign="Left" Font-Bold="true" Text="Multiple Choice Question" ColumnSpan="2" /> </asp:TableRow> <asp:TableRow runat="server"> <asp:TableCell runat="server" HorizontalAlign="Left"> <asp:RadioButtonList ID="RadioButtonQ1" runat="server" RepeatDirection="Vertical" /> </asp:TableCell> </asp:TableRow> </asp:Table> In my VB code behind I have a select statement that retreives the information from the database and randomizes the answers, but I am unable to get t

Dynamically Prepopulating Data on a Label

Hi All, I have a Label which i will like to dynamically prepopulate data on. So pretty much i will like to check the db name on my webconfig file, verify it on the database and populate that line from the db to my label..  Is there a way for me to do that.

Bind Data to a Calender Control

I have a data on my Standby _ Table look like this in database   ID EMP_NO YEAR MONTH DAY 3 10001 2010 09 17 4 10002 2010 09 18 5 10002 2010 09 19   Now I want have this data displayed in a form of a Calendar , actually a full page calendar. My senario is I have employees doing standby weekly but I want to have their standby dates displayed in a form of a calendar , can somebody please help me even if it means I have to change the table structure.   Im using a VS2008 .NET 3.5 Regards,      

Items data binding in Canvas

Hello! I have an ObservableCollection, which contains points with X and Y coordinates. I need to bind this ObservableCollection to Canvas control, but there is no way to bind collection directly to Canvas. I found a few samples with ItemsControl (and ListBox). <Canvas x:Name="Root"> <ItemsControl ItemsSource="{Binding AllObjects}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemContainerStyle> <Style> <Setter Property="Canvas.Left" Value="{Binding Longitude}" /> <Setter Property="Canvas.Top" Value="{Binding Latitude}" /> </Style> </ItemsControl.ItemContainerStyle> <ItemsControl.ItemTemplate> <DataTemplate DataType="{x:Type o:OperationPoint}"> <Ellipse Width="3" Height="3" Fill="Blue" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </Canvas> It works, but there are many elements in visual tree I don't need: Canvas (Root) ItemsControl Border ItemsPresenter Canvas ContentPresenter Ellipse ContentPresenter

How to enable caching on SSRS that using SSAS cube to bind data


Hi All 

 How to set Cach refersh option for a SSRS report that using SSAS cube to bind data 

when i tried to store credential in data source getting error as show below 

"Non-Windows user credentials were supplied for a non-http connection to Analysis Services. The Microsoft SQL Server Analysis Services data extension requires Windows Integrated Security unless connecting via http or https."





Lookup Column Data on seperate Subsite


Is there a way to make a look up reference a column on a seperate subsite?  I was thinking I could do it with BCS but I seem to be having an issue setting up a MOSS 2010 list as a source.

Basically I have SubSiteA with a list that includes some catalog information for systems and SubSiteB is a Doc Center that contains various atricles about the systems. I want to have one column in SubSiteB reference a Column from SubSiteA to use as metadata for search/filter purposes.


Any thoughts?  Thanks

Enterprise Applications Specialist
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend