detailsview中,time设的是只读的,同时在数据库中用getdate()设置的默认值,在运行后,detailsview从数据库中调出来的时间都有的,但是在点击编辑更新之后,time中存的值为空了,怎么改?代码如下:
   <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"  style="position:absolute; left: 552px; top: 520px;"
        DataKeyNames="id" DataSourceID="SqlDataSource2" Height="380px" Width="378px"  HeaderText="详情"   OnPageIndexChanging="DetailsView1_PageIndexChanging" CellPadding="4" ForeColor="#333333" GridLines="None"
          >
        <Fields>
        
            <asp:BoundField DataField="title" HeaderText="主题" SortExpression="title" >
                <ControlStyle Width="300px" />
            </asp:BoundField>
            <asp:BoundField DataField="time" ReadOnly="True" HeaderText="时间" SortExpression="time" >
                <ControlStyle Width="300px" />
            </asp:BoundField>
            
            
            <asp:TemplateField HeaderText="内容" SortExpression="details">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("details") %>' TextMode ="MultiLine"></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("details") %>' TextMode="MultiLine"></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("details") %>'></asp:Label>
                </ItemTemplate>
                <ControlStyle Height="170px" Width="300px" />
                <ItemStyle Height="170px" HorizontalAlign="Left" VerticalAlign="Top" Width="300px"
                    Wrap="True" />
            </asp:TemplateField>
            
            
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                SortExpression="id" Visible="False" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            
        </Fields>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
        <RowStyle BackColor="#EFF3FB" />
        <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConnectionString="<%$ ConnectionStrings:mydbConnectionString2 %>" DeleteCommand="DELETE FROM [tip] WHERE [id] = @original_id"
        InsertCommand="INSERT INTO [tip] ([title], [details], [time]) VALUES (@title, @details, @time)"
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [tip] WHERE ([id] = @id2)"
        UpdateCommand="UPDATE [tip] SET [title] = @title, [details] = @details, [time] = @time WHERE [id] = @original_id">
        <DeleteParameters>
            <asp:Parameter Name="original_id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="details" Type="String" />
            <asp:Parameter DbType="Datetime" Name="time" />
            <asp:Parameter Name="original_id" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="details" Type="String" />
            <asp:Parameter DbType="Datetime" Name="time" />
        </InsertParameters>
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="13" Name="id2" QueryStringField="id" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>