Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identity_Insert ON

Status
Not open for further replies.

dlpastel

Programmer
Aug 8, 2002
114
US
I am using Visual Web Developer 2008 and SQL Server 2005. I am trying to set up a autonumber type of incrementation as I had done with MS Acess
I keep getting the error:
Cannot insert explicit value for identity column in table 'ApcToDo' when IDENTITY_INSERT is set to OFF.

I am not sure where I turn this on or if I need to it to my code manually somewhere.

Here is the code from my project.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
<html xmlns="<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
#form1
{
height: 1030px;
width: 970px;
margin-left: 0px;
}
#form2
{
height: 1027px;
}
.style1
{
width: 100%;
}
.style2
{
width: 905px;
}
.style3
{
width: 61px;
}
.style4
{
width: 63px;
}
.style5
{
width: 870px;
}
.style6
{
width: 850px;
}
</style>
</head>
<body style="text-align: center">
<form id="form1" runat="server">
<div>

<h1 style="text-align: center">
Apc To Do</h1>

</div>
<asp:SqlDataSource ID="dlpastelconnect" runat="server"
ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:dlpastel %>"
DeleteCommand="DELETE FROM [ApcToDo] WHERE [Id] = @original_Id AND [DateIn] = @original_DateIn AND [Complaint] = @original_Complaint AND [ComplaintDetails] = @original_ComplaintDetails AND [Importance] = @original_Importance AND [EntBy] = @original_EntBy AND [Status] = @original_Status AND [DateComplete] = @original_DateComplete AND [Solution] = @original_Solution AND [OkDan] = @original_OkDan AND [OkCheryl] = @original_OkCheryl AND [OkDale] = @original_OkDale AND [OkWes] = @original_OkWes AND [Notes] = @original_Notes AND [Version] = @original_Version AND [VersionDate] = @original_VersionDate AND [PromptChanges] = @original_PromptChanges"
InsertCommand="INSERT INTO [ApcToDo] ([DateIn], [Complaint], [ComplaintDetails], [Importance], [EntBy], [Status], [DateComplete], [Solution], [OkDan], [OkCheryl], [OkDale], [OkWes], [Notes], [Version], [VersionDate], [PromptChanges], [Id]) VALUES (@DateIn, @Complaint, @ComplaintDetails, @Importance, @EntBy, @Status, @DateComplete, @Solution, @OkDan, @OkCheryl, @OkDale, @OkWes, @Notes, @Version, @VersionDate, @PromptChanges, @Id)"
SelectCommand="SELECT * FROM [ApcToDo]"
UpdateCommand="UPDATE [ApcToDo] SET [DateIn] = @DateIn, [Complaint] = @Complaint, [ComplaintDetails] = @ComplaintDetails, [Importance] = @Importance, [EntBy] = @EntBy, [Status] = @Status, [DateComplete] = @DateComplete, [Solution] = @Solution, [OkDan] = @OkDan, [OkCheryl] = @OkCheryl, [OkDale] = @OkDale, [OkWes] = @OkWes, [Notes] = @Notes, [Version] = @Version, [VersionDate] = @VersionDate, [PromptChanges] = @PromptChanges WHERE [Id] = @original_Id AND [DateIn] = @original_DateIn AND [Complaint] = @original_Complaint AND [ComplaintDetails] = @original_ComplaintDetails AND [Importance] = @original_Importance AND [EntBy] = @original_EntBy AND [Status] = @original_Status AND [DateComplete] = @original_DateComplete AND [Solution] = @original_Solution AND [OkDan] = @original_OkDan AND [OkCheryl] = @original_OkCheryl AND [OkDale] = @original_OkDale AND [OkWes] = @original_OkWes AND [Notes] = @original_Notes AND [Version] = @original_Version AND [VersionDate] = @original_VersionDate AND [PromptChanges] = @original_PromptChanges"
OldValuesParameterFormatString="original_{0}"
UpdateCommandType="StoredProcedure">
<DeleteParameters>
<asp:parameter Name="original_Id" Type="Int32" />
<asp:parameter Name="original_DateIn" Type="DateTime" />
<asp:parameter Name="original_Complaint" Type="String" />
<asp:parameter Name="original_ComplaintDetails" Type="String" />
<asp:parameter Name="original_Importance" Type="Int32" />
<asp:parameter Name="original_EntBy" Type="String" />
<asp:parameter Name="original_Status" Type="String" />
<asp:parameter Name="original_DateComplete" Type="DateTime" />
<asp:parameter Name="original_Solution" Type="String" />
<asp:parameter Name="original_OkDan" Type="String" />
<asp:parameter Name="original_OkCheryl" Type="DateTime" />
<asp:parameter Name="original_OkDale" Type="String" />
<asp:parameter Name="original_OkWes" Type="String" />
<asp:parameter Name="original_Notes" Type="String" />
<asp:parameter Name="original_Version" Type="String" />
<asp:parameter Name="original_VersionDate" Type="DateTime" />
<asp:parameter Name="original_PromptChanges" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="DateIn" Type="DateTime" />
<asp:parameter Name="Complaint" Type="String" />
<asp:parameter Name="ComplaintDetails" Type="String" />
<asp:parameter Name="Importance" Type="Int32" />
<asp:parameter Name="EntBy" Type="String" />
<asp:parameter Name="Status" Type="String" />
<asp:parameter Name="DateComplete" Type="DateTime" />
<asp:parameter Name="Solution" Type="String" />
<asp:parameter Name="OkDan" Type="String" />
<asp:parameter Name="OkCheryl" Type="DateTime" />
<asp:parameter Name="OkDale" Type="String" />
<asp:parameter Name="OkWes" Type="String" />
<asp:parameter Name="Notes" Type="String" />
<asp:parameter Name="Version" Type="String" />
<asp:parameter Name="VersionDate" Type="DateTime" />
<asp:parameter Name="PromptChanges" Type="String" />
<asp:parameter Name="original_Id" Type="Int32" />
<asp:parameter Name="original_DateIn" Type="DateTime" />
<asp:parameter Name="original_Complaint" Type="String" />
<asp:parameter Name="original_ComplaintDetails" Type="String" />
<asp:parameter Name="original_Importance" Type="Int32" />
<asp:parameter Name="original_EntBy" Type="String" />
<asp:parameter Name="original_Status" Type="String" />
<asp:parameter Name="original_DateComplete" Type="DateTime" />
<asp:parameter Name="original_Solution" Type="String" />
<asp:parameter Name="original_OkDan" Type="String" />
<asp:parameter Name="original_OkCheryl" Type="DateTime" />
<asp:parameter Name="original_OkDale" Type="String" />
<asp:parameter Name="original_OkWes" Type="String" />
<asp:parameter Name="original_Notes" Type="String" />
<asp:parameter Name="original_Version" Type="String" />
<asp:parameter Name="original_VersionDate" Type="DateTime" />
<asp:parameter Name="original_PromptChanges" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="DateIn" Type="DateTime" />
<asp:parameter Name="Complaint" Type="String" />
<asp:parameter Name="ComplaintDetails" Type="String" />
<asp:parameter Name="Importance" Type="Int32" />
<asp:parameter Name="EntBy" Type="String" />
<asp:parameter Name="Status" Type="String" />
<asp:parameter Name="DateComplete" Type="DateTime" />
<asp:parameter Name="Solution" Type="String" />
<asp:parameter Name="OkDan" Type="String" />
<asp:parameter Name="OkCheryl" Type="DateTime" />
<asp:parameter Name="OkDale" Type="String" />
<asp:parameter Name="OkWes" Type="String" />
<asp:parameter Name="Notes" Type="String" />
<asp:parameter Name="Version" Type="String" />
<asp:parameter Name="VersionDate" Type="DateTime" />
<asp:parameter Name="PromptChanges" Type="String" />
<asp:parameter Name="Id" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
<br />
<table class="style1">
<tr>
<td>
&nbsp;</td>
<td class="style2">
<asp:GridView ID="ToDoGrid" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#CCCCCC"
BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4"
CellSpacing="2" DataKeyNames="Id" DataSourceID="dlpastelconnect"
ForeColor="Black" PageSize="4" style="text-align: center">
<FooterStyle BackColor="#CCCCCC" />
<RowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="DateIn" HeaderText="Date In"
SortExpression="DateIn" />
<asp:BoundField DataField="Complaint" HeaderText="Complaint"
SortExpression="Complaint" />
<asp:BoundField DataField="Importance" HeaderText="Importance"
SortExpression="Importance" />
<asp:BoundField DataField="EntBy" HeaderText="Ent By" SortExpression="EntBy" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
<asp:BoundField DataField="DateComplete" HeaderText="Date Complete"
SortExpression="DateComplete" />
<asp:BoundField DataField="OkCheryl" HeaderText="Ok Cheryl"
SortExpression="OkCheryl" />
<asp:BoundField DataField="OkDale" HeaderText="Ok Dale"
SortExpression="OkDale" />
<asp:CommandField ShowSelectButton="True" />
</Columns>
<PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
</asp:GridView>
<br />
</td>
<td>
<br />
<br />
</td>
</tr>
</table>
<table class="style1">
<tr>
<td class="style4">
&nbsp;</td>
<td class="style5">
<h1 style="width: 831px">
Details</h1>
</td>
<td>
&nbsp;</td>
</tr>
</table>
<table class="style1">
<tr>
<td class="style3">
<br />
</td>
<td style="text-align: left" class="style6">
<asp:FormView ID="ToDoDetailForm" runat="server"
BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px"
CellPadding="2" DataKeyNames="Id" DataSourceID="dlpastelconnect"
ForeColor="Black" Width="970px" Height="241px">
<FooterStyle BackColor="Tan" />
<EditItemTemplate>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date In:&nbsp;&nbsp;<asp:TextBox ID="DateInTextBox" runat="server" Text='<%# Bind("DateIn") %>' />
&nbsp;&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
BackColor="Yellow" ControlToValidate="DateInTextBox"
ErrorMessage="Date In May Not Be Empty" Font-Bold="True">!</asp:RequiredFieldValidator>
&nbsp;&nbsp;&nbsp;EntBy:&nbsp;
<asp:TextBox ID="EntByTextBox" runat="server" Text='<%# Bind("EntBy") %>' />
&nbsp;&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
BackColor="Yellow" ControlToValidate="EntByTextBox"
ErrorMessage="Ent By Must Not Be Blank" Font-Bold="True">!</asp:RequiredFieldValidator>
&nbsp;&nbsp;Importance:&nbsp;
<asp:TextBox ID="ImportanceTextBox" runat="server"
Text='<%# Bind("Importance") %>' />
&nbsp;&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"
BackColor="Yellow" ControlToValidate="ImportanceTextBox"
ErrorMessage="Importance Can Not Be Empty" Font-Bold="True">!</asp:RequiredFieldValidator>
&nbsp;&nbsp; Status:
<asp:TextBox ID="StatusTextBox" runat="server" Text='<%# Bind("Status") %>'
Height="24px" Width="130px" />
&nbsp;
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server"
BackColor="Yellow" ErrorMessage="Status May Not Be Empty" Font-Bold="True">!</asp:RequiredFieldValidator>
<br />
<br />
&nbsp;Complaint: &nbsp;
<asp:TextBox ID="ComplaintTextBox" runat="server" Height="22px"
Text='<%# Bind("Complaint") %>' Width="770px" />
&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
BackColor="Yellow" ControlToValidate="ComplaintTextBox"
ErrorMessage="Complaint May Not Be Empty" Font-Bold="True">!</asp:RequiredFieldValidator>
&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Details :
<asp:TextBox ID="ComplaintDetailsTextBox" runat="server" Height="69px"
Text='<%# Bind("ComplaintDetails") %>' Width="771px"
style="text-align: left" TextMode="MultiLine" />
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Notes:&nbsp;&nbsp;
<asp:TextBox ID="NotesTextBox" runat="server" Height="87px"
Text='<%# Bind("Notes") %>' TextMode="MultiLine"
Width="774px" />
<br />
&nbsp;&nbsp;&nbsp; &nbsp; Date<br />
&nbsp;&nbsp;Complete:&nbsp;&nbsp;
<asp:TextBox ID="DateCompleteTextBox" runat="server"
Text='<%# Bind("DateComplete") %>' />
<br />
&nbsp;
<br />
&nbsp;&nbsp; Solution:&nbsp;&nbsp;&nbsp;
<asp:TextBox ID="SolutionTextBox" runat="server" Height="86px"
Text='<%# Bind("Solution") %>' Width="771px" TextMode="MultiLine" />
<br />
&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp; Ok Dan:&nbsp;
<asp:TextBox ID="OkDanTextBox" runat="server" Text='<%# Bind("OkDan") %>' />
&nbsp;&nbsp; Ok Cheryl:&nbsp;
<asp:TextBox ID="OkCherylTextBox" runat="server"
Text='<%# Bind("OkCheryl") %>' />
&nbsp; Ok Dale:&nbsp;
<asp:TextBox ID="OkDaleTextBox" runat="server" Text='<%# Bind("OkDale") %>' />
&nbsp;&nbsp; OkWes:
<asp:TextBox ID="OkWesTextBox" runat="server" Text='<%# Bind("OkWes") %>' />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp; Version:&nbsp;
<asp:TextBox ID="VersionTextBox" runat="server" Text='<%# Bind("Version") %>' />
&nbsp; VersionDate:
<asp:TextBox ID="VersionDateTextBox" runat="server"
Text='<%# Bind("VersionDate") %>' />
<br />
<br />
&nbsp;&nbsp;&nbsp; Prompt Changes:&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox
ID="PromptChangesTextBox" runat="server"
Height="62px" Text='<%# Bind("PromptChanges") %>' Width="792px"
TextMode="MultiLine" />
<br />
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
BackColor="White" Width="858px" />
<br />
&nbsp;<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Save" BackColor="White" BorderStyle="Groove" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel"
BackColor="White" BorderStyle="Groove" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
<br />
</EditItemTemplate>
<InsertItemTemplate>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DateIn:
<asp:TextBox ID="DateInTextBox0" runat="server" Text='<%# Bind("DateIn") %>' />
&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="DateInTextBox0" ErrorMessage="Date In May Not Be Empty"
BackColor="Yellow" Font-Bold="True">!</asp:RequiredFieldValidator>
&nbsp;&nbsp; EntBy:
<asp:TextBox ID="EntByTextBox0" runat="server" Text='<%# Bind("EntBy") %>' />
&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
BackColor="Yellow" ControlToValidate="EntByTextBox0"
ErrorMessage="Ent By May Not Be Empty" Font-Bold="True">!</asp:RequiredFieldValidator>
&nbsp;&nbsp; Importance:
<asp:TextBox ID="ImportanceTextBox0" runat="server"
Text='<%# Bind("Importance") %>' />
&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
BackColor="Yellow" ControlToValidate="ImportanceTextBox0"
ErrorMessage="Importance Must Not Be Empty" Font-Bold="True">!</asp:RequiredFieldValidator>
&nbsp;&nbsp; Status:
<asp:TextBox ID="StatusTextBox0" runat="server" Text='<%# Bind("Status") %>'
/>
&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"
ErrorMessage="Status May Not Be Empty" BackColor="Yellow"
ControlToValidate="StatusTextBox0" Font-Bold="True">!</asp:RequiredFieldValidator>
<br />
<br />
Complaint:
<asp:TextBox ID="ComplaintTextBox0" runat="server" Height="18px"
Text='<%# Bind("Complaint") %>' Width="725px" />
&nbsp;&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ControlToValidate="ComplaintTextBox0"
ErrorMessage="Complaint May Not Be Empty" BackColor="Yellow" Font-Bold="True">!</asp:RequiredFieldValidator>
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp; Details:
<asp:TextBox ID="ComplaintDetailsTextBox0" runat="server" Height="48px"
Text='<%# Bind("ComplaintDetails") %>' Width="727px"
TextMode="MultiLine" />
<br />
<br />
&nbsp;&nbsp;&nbsp; Notes:&nbsp;&nbsp;
<asp:TextBox ID="NotesTextBox0" runat="server" Height="52px"
style="margin-left: 0px"
Text='<%# Bind("Notes") %>' TextMode="MultiLine"
Width="724px" />
<br />
Date
<br />
Complete:&nbsp;
<asp:TextBox ID="DateCompleteTextBox0" runat="server"
Text='<%# Bind("DateComplete") %>' />
<br />
<br />
&nbsp;&nbsp; Solution:
<asp:TextBox ID="SolutionTextBox0" runat="server" Height="56px"
Text='<%# Bind("Solution") %>' Width="736px" TextMode="MultiLine" />
<br />
<br />
Ok Dan:&nbsp;&nbsp;&nbsp;
<asp:TextBox ID="OkDanTextBox0" runat="server" Text='<%# Bind("OkDan") %>' />
&nbsp; Ok Cheryl:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:TextBox ID="OkCherylTextBox0" runat="server"
Text='<%# Bind("OkCheryl") %>' />
&nbsp; Ok Dale:
<asp:TextBox ID="OkDaleTextBox0" runat="server" Text='<%# Bind("OkDale") %>' />
&nbsp; OkWes:
<asp:TextBox ID="OkWesTextBox0" runat="server" Text='<%# Bind("OkWes") %>' />
<br />
<br />
&nbsp;&nbsp; Version:&nbsp;
<asp:TextBox ID="VersionTextBox0" runat="server"
Text='<%# Bind("Version") %>' />
&nbsp; Version Date:
<asp:TextBox ID="VersionDateTextBox0" runat="server"
Text='<%# Bind("VersionDate") %>' />
&nbsp;
<br />
<br />
Prompt
<br />
Changes:&nbsp;&nbsp;
<asp:TextBox ID="PromptChangesTextBox0" runat="server" Height="43px"
Text='<%# Bind("PromptChanges") %>' Width="701px" TextMode="MultiLine" />
<br />
<br />
&nbsp;&nbsp;&nbsp;<asp:ValidationSummary ID="ValidationSummary2" runat="server" BackColor="White"
Height="35px" Width="809px" />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Save" BackColor="White" BorderStyle="Outset" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
CommandName="Cancel" Text="Cancel" BackColor="White"
BorderStyle="Outset" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</InsertItemTemplate>
<ItemTemplate>
<b>Date In:</b>
<asp:Label ID="DateInLabel" runat="server" Text='<%# Bind("DateIn") %>' />
&nbsp; <b>Ent By</b>:
<asp:Label ID="EntByLabel" runat="server" Text='<%# Bind("EntBy") %>' />
&nbsp;<b>Importance:</b>
<asp:Label ID="ImportanceLabel" runat="server"
Text='<%# Bind("Importance") %>' />
<b>Status:</b>
<asp:Label ID="StatusLabel" runat="server" Text='<%# Bind("Status") %>' />
<br />
<b>Complaint:</b>
<asp:Label ID="ComplaintLabel" runat="server" Text='<%# Bind("Complaint") %>' />
<br />
<b>Complaint Details:</b>
<asp:Label ID="ComplaintDetailsLabel" runat="server"
Text='<%# Bind("ComplaintDetails") %>' />
<br />
<b>Notes:</b>
<asp:Label ID="NotesLabel" runat="server" Text='<%# Bind("Notes") %>' />
<br />
<b>Date Complete:</b>
<asp:Label ID="DateCompleteLabel" runat="server"
Text='<%# Bind("DateComplete") %>' />
<br />
<b>Solution:</b>
<asp:Label ID="SolutionLabel" runat="server" Text='<%# Bind("Solution") %>' />
<br />
<b>Ok Dan:</b>
<asp:Label ID="OkDanLabel" runat="server" Text='<%# Bind("OkDan") %>' />
&nbsp;<b>Ok Cheryl:</b>
<asp:Label ID="OkCherylLabel" runat="server" Text='<%# Bind("OkCheryl") %>' />
&nbsp;<b>Ok Dale:</b>
<asp:Label ID="OkDaleLabel" runat="server" Text='<%# Bind("OkDale") %>' />
&nbsp;<b>Ok Wes:</b>
<asp:Label ID="OkWesLabel" runat="server" Text='<%# Bind("OkWes") %>' />
<br />
<b>Version:</b>
<asp:Label ID="VersionLabel" runat="server" Text='<%# Bind("Version") %>' />
&nbsp;VersionDate:
<asp:Label ID="VersionDateLabel" runat="server"
Text='<%# Bind("VersionDate") %>' />
<br />
<b>Prompt Changes:</b>
<asp:Label ID="PromptChangesLabel" runat="server"
Text='<%# Bind("PromptChanges") %>' />
<br />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" BorderStyle="Groove" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete" BackColor="White"
BorderStyle="Groove" />
&nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
CommandName="New" Text="New" BackColor="White" BorderStyle="Groove" />
</ItemTemplate>
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
HorizontalAlign="Center" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<InsertRowStyle BackColor="#339966" />
<EditRowStyle BackColor="#3366FF" ForeColor="GhostWhite" Width="950px" />
</asp:FormView>
</td>
<td>
&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>


Thanks in advance
Dan
 
As the exception messages states you are trying to insert a value into an auto-incrementing column. the problem is your insert statement. you are trying to insert a value into the Id column. remove this field and parameter and it should work as expected.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thank you for the answer, that did it!. In this master-detail format, how would I put the details on a separate form so that when the user selects a row a separat page opens up with the Form View
 
use a link button on the summary row "View Details" the link would point to Details.aspx?id=###. where ### is the pk for that row. then, load the data using the id and display on the page like any other form.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Kind of new to this. Details.aspx would be the new page to link to right? But where do I find the Id and what is the pk?
 
pk = primary key

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top