Ciao A tutti,
mi sto avvicinando ad asp.net + SQLserver...

Ho fatto una pagina di prova ma incotnro un problema sull'update e il formato data. Il messaggio di errore che compare é "Arithmetic overflow error converting expression to data type datetime.
The statement has been terminated".

Questo mi succede sul campo date of birth...

Ho fatto un pò di tentativi ma senza successo... leggendo tra i vecchi topic ho letto il suggerimento di passare la data come parametro ma non sono giunto a conclusioni...

Sapresti indicarmi uan via di uscita? Metto in codice....

grazie in anticipo

Luca


codice:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="modulo_dettaglio.aspx.vb" Inherits="Relazioni_modulo_dettaglio" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>PAGINA MODULO MODIFICA</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ProvaDBConnectionString %>" 
            SelectCommand="SELECT [PT_ID_No], [PT_ID], [FirstNam], [LastName], [Sex], [DaBirth], [ID_Med], [RandoCod], FROM [Demographic table] WHERE ([PT_ID_No] = @PT_ID_No)"
            UpdateCommand="UPDATE [Demographic table] SET FirstNam=@FirstNam, LastName=@LastName, DaBirth=@DaBirth WHERE PT_ID_No=@PT_ID_No"
            >
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="%" Name="PT_ID_No" 
                    QueryStringField="PT_ID_No" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        
        <asp:FormView ID="FormView1" runat="server" AllowPaging="True" 
            DataSourceID="SqlDataSource1" CellPadding="10" CellSpacing="5" 
            style="font-family: Arial, Helvetica, sans-serif; font-size: small" DataKeyNames="PT_ID_No">
   
        <ItemTemplate>
                  <table>
                    <tr>
                      <td align="left">ID numerico

                      <asp:Label id="PT_ID_No" runat="server" Text='<%# Eval("PT_ID_No") %>' /></td>
                      <td align="left">Nome

                      <asp:Label id="FirstNam" runat="server" Text='<%# Eval("FirstNam") %>' /></td>
                      <td align="left">Cognome

                      <asp:Label id="LastName" runat="server" Text='<%# Eval("LastName") %>' /></td>
                      <td align="left">Data Nascita

                      <asp:Label id="DaBirth" runat="server" Text='<%# Eval("DaBirth") %>' /></td>
                      <td valign="bottom"><asp:LinkButton ID="EditButton"
                                        Text="Modifica"
                                        CommandName="Edit"
                                        RunAt="server"/></td>
                    </tr>
                    </table>                 
       </ItemTemplate>
       <EditItemTemplate>
                  <table>
                    <tr><td align="left">PT_ID_No: <%#Eval("PT_ID_No")%></td></tr>

                    <tr><td align="left">First Name:

                        <asp:TextBox ID="EditFirstNameTextBox" 
                                         Text='<%# Bind("FirstNam") %>' 
                                         RunAt="Server" /><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                                         ErrorMessage="FIRST NAME IS REQUIRED" ControlToValidate="EditFirstNameTextBox"></asp:RequiredFieldValidator></td>
                    </tr>
                    <tr>
                        <td align="left">Last Name:

                        <asp:TextBox ID="EditLastNameTextBox" 
                                         Text='<%# Bind("LastName") %>' 
                                         RunAt="Server" /><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                                         ErrorMessage="LAST NAME IS REQUIRED" ControlToValidate="EditLastNameTextBox"></asp:RequiredFieldValidator></td>
                    </tr>
                    <tr>
                        <td align="left">Date of Birth:

                        <asp:TextBox ID="EditDaBirthTextBox" 
                                         Text='<%# Bind("DaBirth") %>' 
                                         RunAt="Server" HtmlEncode="False"/></td>
                    </tr>
                                         <tr>
                      <td colspan="2">
                        <asp:LinkButton ID="UpdateButton"
                                        Text="Update"
                                        CommandName="Update"
                                        RunAt="server"/>
                        
                        <asp:LinkButton ID="CancelUpdateButton"
                                        Text="Cancel"
                                        CommandName="Cancel"
                                        RunAt="server"/>
                      </td>
                    </tr>
                  </table>                 
                </EditItemTemplate>
    </asp:FormView>
    </div>
    </form>
</body>
</html>