Det har varit lite dåligt med svar här, men jag gör ändå ett nytt försök.Problem med uppdate och delete i DetailsView1.
Databas Access.
Jag har låtit programet autogenerera insert, update och delete.
Insert fungerar perfekt, därimot inte update och delete.
Jag får inga som helst error, men ingenting händer.
Så här ser det ut:
<code>
<asp:AccessDataSource ID="AccessDataSource3" runat="server" ConflictDetection="CompareAllValues"
DataFile="~/App_Data/Work.mdb" DeleteCommand="DELETE FROM [t_Forening] WHERE [PortID]
= ? AND [Forening] = ? AND [Tillhor] = ? AND [Adress] = ? AND [PostNr] = ? AND [Ort] = ? AND
[KontaktNamn] = ?
AND [Epost] = ? AND [URL] = ? AND [Klient] = ? AND [HaveURL] = ? AND [Free] = ?
AND [Epostsent] = ? AND [Epostsentdate] = ?"
InsertCommand="INSERT INTO [t_Forening] ([Forening], [Tillhor], [Adress], [PostNr], [Ort], [KontaktNamn],
[Epost], [URL], [Klient], [HaveURL], [Free], [Epostsent], [Epostsentdate]) VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [t_Forening] WHERE ([PortID] = ?) ORDER BY [Forening], [Ort], [KontaktNamn]"
UpdateCommand="UPDATE [t_Forening] SET [Forening] = ?, [Tillhor] = ?, [Adress] = ?, [PostNr]
= ?, [Ort] = ?, [KontaktNamn] = ?, [Epost] = ?, [URL] = ?, [Klient] = ?,
[HaveURL] = ?, [Free] = ?,
[Epostsent] = ?, [Epostsentdate] = ? WHERE [PortID] = ? AND [Forening] = ? AND [Tillhor] = ? AND
[Adress] = ? AND [PostNr] = ? AND [Ort] = ? AND [KontaktNamn] = ? AND [Epost] = ? AND [URL] = ? AND [Klient] = ?
AND [HaveURL] = ? AND [Free] = ? AND [Epostsent] = ? AND [Epostsentdate] = ?">
<DeleteParameters>
<asp:Parameter Name="original_PortID" Type="Int32" />
<asp:Parameter Name="original_Forening" Type="String" />
<asp:Parameter Name="original_Tillhor" Type="String" />
<asp:Parameter Name="original_Adress" Type="String" />
<asp:Parameter Name="original_PostNr" Type="String" />
<asp:Parameter Name="original_Ort" Type="String" />
<asp:Parameter Name="original_KontaktNamn" Type="String" />
<asp:Parameter Name="original_Epost" Type="String" />
<asp:Parameter Name="original_URL" Type="String" />
<asp:Parameter Name="original_Klient" Type="Boolean" />
<asp:Parameter Name="original_HaveURL" Type="Boolean" />
<asp:Parameter Name="original_Free" Type="Boolean" />
<asp:Parameter Name="original_Epostsent" Type="Boolean" />
<asp:Parameter Name="original_Epostsentdate" Type="DateTime" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Forening" Type="String" />
<asp:Parameter Name="Tillhor" Type="String" />
<asp:Parameter Name="Adress" Type="String" />
<asp:Parameter Name="PostNr" Type="String" />
<asp:Parameter Name="Ort" Type="String" />
<asp:Parameter Name="KontaktNamn" Type="String" />
<asp:Parameter Name="Epost" Type="String" />
<asp:Parameter Name="URL" Type="String" />
<asp:Parameter Name="Klient" Type="Boolean" />
<asp:Parameter Name="HaveURL" Type="Boolean" />
<asp:Parameter Name="Free" Type="Boolean" />
<asp:Parameter Name="Epostsent" Type="Boolean" />
<asp:Parameter Name="Epostsentdate" Type="DateTime" />
<asp:Parameter Name="original_PortID" Type="Int32" />
<asp:Parameter Name="original_Forening" Type="String" />
<asp:Parameter Name="original_Tillhor" Type="String" />
<asp:Parameter Name="original_Adress" Type="String" />
<asp:Parameter Name="original_PostNr" Type="String" />
<asp:Parameter Name="original_Ort" Type="String" />
<asp:Parameter Name="original_KontaktNamn" Type="String" />
<asp:Parameter Name="original_Epost" Type="String" />
<asp:Parameter Name="original_URL" Type="String" />
<asp:Parameter Name="original_Klient" Type="Boolean" />
<asp:Parameter Name="original_HaveURL" Type="Boolean" />
<asp:Parameter Name="original_Free" Type="Boolean" />
<asp:Parameter Name="original_Epostsent" Type="Boolean" />
<asp:Parameter Name="original_Epostsentdate" Type="DateTime" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Forening" Type="String" />
<asp:Parameter Name="Tillhor" Type="String" />
<asp:Parameter Name="Adress" Type="String" />
<asp:Parameter Name="PostNr" Type="String" />
<asp:Parameter Name="Ort" Type="String" />
<asp:Parameter Name="KontaktNamn" Type="String" />
<asp:Parameter Name="Epost" Type="String" />
<asp:Parameter Name="URL" Type="String" />
<asp:Parameter Name="Klient" Type="Boolean" />
<asp:Parameter Name="HaveURL" Type="Boolean" />
<asp:Parameter Name="Free" Type="Boolean" />
<asp:Parameter Name="Epostsent" Type="Boolean" />
<asp:Parameter Name="Epostsentdate" Type="DateTime" />
</InsertParameters>
</code>
Någon som har en susning om vad det är för fel???
[REDIGERAT]
Det var mycket enklare än vad jag hadde trott.
<code>
DeleteCommand="DELETE FROM [t_Forening] WHERE ([PortID] = ?)"
UpdateCommand="UPDATE [t_Forening] SET [Forening] = ?, [Tillhor] = ?, [Adress] = ?, [PostNr] = ?, [Ort] = ?, [KontaktNamn] = ?,
[Epost] = ?, [URL] = ?, [Klient] = ?, [HaveURL] = ?, [Free] = ?,
[Epostsent] = ?, [Epostsentdate] = ? WHERE ([PortID] = ?)">
</code>
Jag la in det här, om någon annan får samma problem.