Access Date/time to SQL to only show Date

Discussion in 'Software' started by Whothehell, Jul 27, 2006.

  1. Whothehell

    Whothehell

    Joined:
    Jul 27, 2006
    Messages:
    2
    I currently have a Microsoft Access database that has a column for date, and its data type is date/time , format short date. I'm building a website to show all the data from the database onto a webpage, using SQL. When I load the webpage I see the date column showing both the date and the time.

    <asp:BoundField DataFormatString="{0:d}" DataField="prsnnl_hire_date" SortExpression="prsnnl_hire_date" HeaderText="Hire Date"></asp:BoundField>

    That is the code above, and I thought the DataFomatString="{0:d}" would solve my problem but it hasn't. Anyone have any ideas for it just to show the date??

    P.S. I'm a noob
    Whothehell, Jul 27, 2006
    #1
    1. Advertising

  2. Whothehell

    Donald

    Joined:
    Jul 25, 2006
    Messages:
    1
    Hello you can say to me as updating of a database in SQL from a form in ASP.Net? Thank you very much for your help.
    Donald reyes
    Donald, Jul 27, 2006
    #2
    1. Advertising

  3. Whothehell

    Whothehell

    Joined:
    Jul 27, 2006
    Messages:
    2
    All right to add some clarification.
    I'm using Visual Web Developer 2005 Express Edition
    and using ASP.net gridview.

    <script runat="server">


    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

    End Sub



    </script>

    <form id="Form1" runat=server>
    <asp:gridview id="GridView1" runat="server" cellpadding="4" datasourceid="Test"
    forecolor="#333333" gridlines="None" AutoGenerateColumns="False" DataKeyNames="prsnnl_id" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
    <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True"></FooterStyle>
    <Columns>
    <asp:BoundField ReadOnly="True" DataField="prsnnl_id" InsertVisible="False" SortExpression="prsnnl_id" HeaderText="prsnnl_id"></asp:BoundField>
    <asp:BoundField DataField="prsnnl_lst_nm" SortExpression="prsnnl_lst_nm" HeaderText="prsnnl_lst_nm"></asp:BoundField>
    <asp:BoundField DataField="prsnnl_first_nm" SortExpression="prsnnl_first_nm" HeaderText="prsnnl_first_nm"></asp:BoundField>
    <asp:BoundField DataFormatString="{0:d}" DataField="prsnnl_hire_date" SortExpression="prsnnl_hire_date" HeaderText="prsnnl_hire_date"></asp:BoundField>
    <asp:BoundField DataFormatString="{0:d}" DataField="prsnnl_terminate_date" SortExpression="prsnnl_terminate_date" HeaderText="prsnnl_terminate_date"></asp:BoundField>
    <asp:CheckBoxField DataField="prsnnl_security_folder_ind" SortExpression="prsnnl_security_folder_ind" HeaderText="prsnnl_security_folder_ind"></asp:CheckBoxField>
    <asp:BoundField DataField="job_level_nm" SortExpression="job_level_nm" HeaderText="job_level_nm"></asp:BoundField>
    <asp:BoundField DataField="org_grp_nm" SortExpression="org_grp_nm" HeaderText="org_grp_nm"></asp:BoundField>
    <asp:BoundField DataField="co_nm" SortExpression="co_nm" HeaderText="co_nm"></asp:BoundField>
    <asp:BoundField DataField="security_officer_lst_nm" SortExpression="security_officer_lst_nm" HeaderText="security_officer_lst_nm"></asp:BoundField>
    </Columns>

    <RowStyle BackColor="#F7F6F3" ForeColor="#333333"></RowStyle>

    <EditRowStyle BackColor="#999999"></EditRowStyle>

    <SelectedRowStyle BackColor="#E2DED6" ForeColor="#333333" Font-Bold="True"></SelectedRowStyle>

    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"></PagerStyle>

    <HeaderStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True"></HeaderStyle>

    <AlternatingRowStyle BackColor="White" ForeColor="#284775"></AlternatingRowStyle>
    </asp:gridview>
    <asp:accessdatasource id="Test" runat="server" datafile="~/Data/Databasne_name.mdb"
    selectcommand="SELECT * FROM [PERSONNEL]"></asp:accessdatasource>
    </form>

    THat's the source code, and I have nothing written in the vb portion.
    Whothehell, Jul 27, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Whiting
    Replies:
    2
    Views:
    678
    Brian Whiting
    Dec 29, 2005
  2. Matt Scoff

    my access-list allows SQL access?

    Matt Scoff, Jun 12, 2006, in forum: Cisco
    Replies:
    0
    Views:
    1,390
    Matt Scoff
    Jun 12, 2006
  3. Tommy
    Replies:
    1
    Views:
    1,746
    Mr. Arnold
    Nov 29, 2007
  4. Vicky
    Replies:
    0
    Views:
    660
    Vicky
    Apr 6, 2007
  5. Darrilgibson@gmail.com

    MCITP SQL Server 2005 or SQL Server 2008

    Darrilgibson@gmail.com, Dec 19, 2007, in forum: MCITP
    Replies:
    0
    Views:
    1,420
    Darrilgibson@gmail.com
    Dec 19, 2007
Loading...

Share This Page