I have created a user profile page for a simple website in C#.net. I’m using detailsview to show the user information but I want to hide the column names stored in database instead of it I want to write them in html table. Details view provide two columns First one for the Column names in the database and the second for value for these columns. I want to remove the first one and define it manually.
Is there any way to hide the all column names and show only values of detailsview, and if not then please suggest me to retrieve information for profile page and editing feature also?
Code for detailsview:
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
BorderWidth="0px" DataSourceID="UserDetails" Height="287px"
style="text-align: left" Width="394px">
<Fields>
<asp:BoundField DataField="Login" HeaderText="Login" SortExpression="Login" />
<asp:BoundField DataField="Uname" HeaderText="Uname" SortExpression="Uname" />
<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
<asp:BoundField DataField="DOB" HeaderText="DOB" SortExpression="DOB" />
<asp:BoundField DataField="Hometown" HeaderText="Hometown"
SortExpression="Hometown" />
<asp:BoundField DataField="Interests" HeaderText="Interests"
SortExpression="Interests" />
</Fields>
</asp:DetailsView>
Code for database:
<asp:SqlDataSource ID="UserDetails" runat="server"
ConnectionString="<%$ ConnectionStrings:ConString %>"
SelectCommand="SELECT [Login], [Uname], [Email], [DOB], [Hometown], [Interests] FROM [Profile] WHERE ([Login] LIKE '%' + @Login + '%')">
<SelectParameters>
<asp:SessionParameter Name="Login" SessionField="usr" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
You can hide or rename the column of detailview without using html table , fellow this link
http://www.devmanuals.com/tutorials/ms/aspdotnet/detailsview.html