Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey,

I built a table from the database and I have some questions -
1. How can I make that in the row of the name, whoever clicks on the name will reach the customer's page?
2. I made that only those whose value is 1000 will appear in the list (<asp: parameter="" defaultvalue="1000" name="CustomerCompany" type="Int32">) How can I change the value in the code behind?
3. I have a line of date - how can I display only the day, month and year (without the hours and minutes?)

Best regards

What I have tried:

<asp:GridView runat="server" ID="grdContact" AutoGenerateColumns="False" DataKeyNames="IdCustomer" DataSourceID="SqlDataSource1">
    <Columns>
        <asp:BoundField DataField="CustomerName" ControlStyle-CssClass="td1 th1" HeaderText="name" SortExpression="CustomerName" />
        <asp:BoundField DataField="CustomerPhone" ControlStyle-CssClass="td1 th1" HeaderText="phone" SortExpression="CustomerPhone" />
        <asp:BoundField DataField="CustomerAdress" ControlStyle-CssClass="td1 th1" HeaderText="adress" SortExpression="CustomerAdress" />
        <asp:BoundField DataField="CustomerMail" ControlStyle-CssClass="td1 th1" HeaderText="mail" SortExpression="CustomerMail" />
        <asp:BoundField DataField="CustomerBirthDay" ControlStyle-CssClass="td1 th1" HeaderText="birthday" SortExpression="CustomerBirthDay" />
    </Columns>
</asp:GridView>


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\ADMIN\source\repos\TOPjob\DalTJ\App_Data\Database.mdf;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [Customers] WHERE ([CustomerCompany] = @CustomerCompany)">
    <SelectParameters>
        <asp:Parameter DefaultValue="1000" Name="CustomerCompany" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
Posted
Updated 12-Oct-20 19:02pm
v2
Comments
[no name] 12-Oct-20 13:36pm    
If it's "ASP.NET", why didn't you tag it as such?
Member 14683862 13-Oct-20 1:03am    
I'm sorry, I corrected
Maybe you can help me anyway ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900