Hi,
I made a detailsview for inserting records.
I also made a gridview for editing and deleting the same records.
The keyfield is an autonumbering field in Access (pcnr).
My problem is: I can see the new inserted records in the gridview but I
can't delete or edit them. When clicking on delete or edit link, nothing
happens (no error either). All the others records (not inserted via the
detailsview) can be edited and deleted.
Thanks for help
Marc
Here part of my code with the gridview:
---------------------------------------
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConflictDetecti on="CompareAllV alues"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0;Data Source=C:\mydb"
DeleteCommand=" DELETE FROM [pc] WHERE [pcnr] = ? AND [naam] = ? AND
[defect] = ? AND [type] = ? AND [software] = ? AND [lokaal] = ?"
InsertCommand=" INSERT INTO [pc] ([pcnr], [naam], [defect], [type],
[software], [lokaal]) VALUES (?, ?, ?, ?, ?, ?)"
OldValuesParame terFormatString ="original_{ 0}"
ProviderName="S ystem.Data.OleD b"
SelectCommand=" SELECT * FROM [pc]" UpdateCommand=" UPDATE [pc] SET [naam]
= ?, [defect] = ?, [type] = ?, [software] = ?, [lokaal] = ? WHERE [pcnr] = ?
AND [naam] = ? AND [defect] = ? AND [type] = ? AND [software] = ? AND
[lokaal] = ?">
<DeleteParamete rs>
<asp:Paramete r Name="original_ pcnr" Type="Int32" />
<asp:Paramete r Name="original_ naam" Type="String" />
<asp:Paramete r Name="original_ defect" Type="Boolean" />
<asp:Paramete r Name="original_ type" Type="String" />
<asp:Paramete r Name="original_ software" Type="String" />
<asp:Paramete r Name="original_ lokaal" Type="String" />
</DeleteParameter s>
<UpdateParamete rs>
<asp:Paramete r Name="naam" Type="String" />
<asp:Paramete r Name="defect" Type="Boolean" />
<asp:Paramete r Name="type" Type="String" />
<asp:Paramete r Name="software" Type="String" />
<asp:Paramete r Name="lokaal" Type="String" />
<asp:Paramete r Name="original_ pcnr" Type="Int32" />
<asp:Paramete r Name="original_ naam" Type="String" />
<asp:Paramete r Name="original_ defect" Type="Boolean" />
<asp:Paramete r Name="original_ type" Type="String" />
<asp:Paramete r Name="original_ software" Type="String" />
<asp:Paramete r Name="original_ lokaal" Type="String" />
</UpdateParameter s>
</asp:SqlDataSour ce>
<asp:GridView ID="GridView1" runat="server" AllowPaging="Tr ue"
AllowSorting="T rue" PageSize="14" width="990px"
AutoGenerateCol umns="False" CellPadding="4" DataKeyNames="p cnr"
DataSourceID="S qlDataSource1"
ForeColor="#333 333" GridLines="None ">
<Columns>
<asp:CommandFie ld ShowEditButton= "True" />
<asp:TemplateFi eld>
<ItemTemplate >
<asp:LinkButt on ID="lb1" runat="server"
OnClientClick=" return confirm(yes?'); "
CommandName="De lete">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="pcnr " HeaderText="pcn r"
InsertVisible=" False" ReadOnly="True"
SortExpression= "pcnr" />
<asp:BoundFie ld DataField="naam " HeaderText="naa m"
SortExpression= "naam" />
<asp:CheckBoxFi eld DataField="defe ct" HeaderText="def ect"
SortExpression= "defect" />
<asp:BoundFie ld DataField="type " HeaderText="typ e"
SortExpression= "type" />
<asp:BoundFie ld DataField="soft ware" HeaderText="sof tware"
SortExpression= "software" />
<asp:BoundFie ld DataField="loka al" HeaderText="lok aal"
SortExpression= "lokaal" />
</Columns>
</asp:GridView> 1 1856
I found it.
All the fields must be filled ..
"Marc" <mm*@ze.azschre ef in bericht
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Hi,
I made a detailsview for inserting records.
I also made a gridview for editing and deleting the same records.
The keyfield is an autonumbering field in Access (pcnr).
My problem is: I can see the new inserted records in the gridview but I
can't delete or edit them. When clicking on delete or edit link, nothing
happens (no error either). All the others records (not inserted via the
detailsview) can be edited and deleted.
Thanks for help
Marc
Here part of my code with the gridview:
---------------------------------------
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConflictDetecti on="CompareAllV alues"
ConnectionStrin g="Provider=Mic rosoft.Jet.OLED B.4.0;Data
Source=C:\mydb"
DeleteCommand=" DELETE FROM [pc] WHERE [pcnr] = ? AND [naam] = ? AND
[defect] = ? AND [type] = ? AND [software] = ? AND [lokaal] = ?"
InsertCommand=" INSERT INTO [pc] ([pcnr], [naam], [defect], [type],
[software], [lokaal]) VALUES (?, ?, ?, ?, ?, ?)"
OldValuesParame terFormatString ="original_{ 0}"
ProviderName="S ystem.Data.OleD b"
SelectCommand=" SELECT * FROM [pc]" UpdateCommand=" UPDATE [pc] SET [naam]
= ?, [defect] = ?, [type] = ?, [software] = ?, [lokaal] = ? WHERE [pcnr] =
? AND [naam] = ? AND [defect] = ? AND [type] = ? AND [software] = ? AND
[lokaal] = ?">
<DeleteParamete rs>
<asp:Paramete r Name="original_ pcnr" Type="Int32" />
<asp:Paramete r Name="original_ naam" Type="String" />
<asp:Paramete r Name="original_ defect" Type="Boolean" />
<asp:Paramete r Name="original_ type" Type="String" />
<asp:Paramete r Name="original_ software" Type="String" />
<asp:Paramete r Name="original_ lokaal" Type="String" />
</DeleteParameter s>
<UpdateParamete rs>
<asp:Paramete r Name="naam" Type="String" />
<asp:Paramete r Name="defect" Type="Boolean" />
<asp:Paramete r Name="type" Type="String" />
<asp:Paramete r Name="software" Type="String" />
<asp:Paramete r Name="lokaal" Type="String" />
<asp:Paramete r Name="original_ pcnr" Type="Int32" />
<asp:Paramete r Name="original_ naam" Type="String" />
<asp:Paramete r Name="original_ defect" Type="Boolean" />
<asp:Paramete r Name="original_ type" Type="String" />
<asp:Paramete r Name="original_ software" Type="String" />
<asp:Paramete r Name="original_ lokaal" Type="String" />
</UpdateParameter s>
</asp:SqlDataSour ce>
<asp:GridView ID="GridView1" runat="server" AllowPaging="Tr ue"
AllowSorting="T rue" PageSize="14" width="990px"
AutoGenerateCol umns="False" CellPadding="4" DataKeyNames="p cnr"
DataSourceID="S qlDataSource1"
ForeColor="#333 333" GridLines="None ">
<Columns>
<asp:CommandFie ld ShowEditButton= "True" />
<asp:TemplateFi eld>
<ItemTemplate >
<asp:LinkButt on ID="lb1" runat="server"
OnClientClick=" return confirm(yes?'); "
CommandName="De lete">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="pcnr " HeaderText="pcn r"
InsertVisible=" False" ReadOnly="True"
SortExpression= "pcnr" />
<asp:BoundFie ld DataField="naam " HeaderText="naa m"
SortExpression= "naam" />
<asp:CheckBoxFi eld DataField="defe ct" HeaderText="def ect"
SortExpression= "defect" />
<asp:BoundFie ld DataField="type " HeaderText="typ e"
SortExpression= "type" />
<asp:BoundFie ld DataField="soft ware" HeaderText="sof tware"
SortExpression= "software" />
<asp:BoundFie ld DataField="loka al" HeaderText="lok aal"
SortExpression= "lokaal" />
</Columns>
</asp:GridView> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Alex |
last post by:
Hi,
hi have a table with 2.5 million records which i try do delete. i have
several constraints on it too.
i tried to delete the records using delete but it does not seem to work.
the delete runs forever. hrs...
i cannot truncate it as it complains about foreign keys.
What is the problem ?
Thanks
|
by: P |
last post by:
Hello,
I am having a difficult time updating a record via a stored procedure using
the gridview and sqldatasource. I cannot seem to be able to find a way to set
everything up so that I can pass the applicable fields in the gridview to a
sqldatasource which in turn calls a sproc with the appropriate parameters and
data. Any ideas?
Thanks in advance,
|
by: David Ching |
last post by:
I am not getting any response to my previous question on reusing a
DetailsView to insert and edit the selected row in a GridView.
So I'll ask an even more basic question. Newbie alert! ;) When the user
clicks the Edit link in a GridView, is it common to use a DetailsView to
edit that row instead of putting the GridView into Edit mode and editing the
row in place? I would assume so, because the GridView does not typically
have columns...
|
by: cathal670 |
last post by:
Here is the link to a zip file containing my web site, database is in the database folder
My Web Site
To download it, type in the verification text, wait the 30 second delay and press the grey download button.
The problem I am having is that I cannot write any new records to the database, or edit it or delete them. I am hoping that someone could run the web site on their machine and tell me what is wrong with it. I think it may be a...
|
by: sh26 |
last post by:
I can Add and Delete (A, CName, MX and TXT) Dns records on the Dns Server using C# code. The problem I am having is if someone manaully creates a TXT record on the Dns Server, I cannot delete that particular record using the same C# code. Here is what I am using to delete the records:
public void DeleteRecord(string domain, string recordName, string recordType, string recordData)
{
try
{
...
| |
by: Michael |
last post by:
It seems that a gridview allows us to delete only a single row at a time.
How to extend this functionality to select multiple rows and delete all of
the selected rows in a single stroke? just like what hotmail web UI is doing
now (having the option of selecting multiple rows (using the checkbox
provided) and perform a set of operations on them)
|
by: Andy B |
last post by:
Is there any simple examples of edit/deleteing rows in a GridView that has
its datasource set to an xml object? I need to know, because the project I'm
working on doesn't call for a database but more of xml type of storage.
|
by: Andy B |
last post by:
I have a GridView in asp.net. I want to set its datasource to some xml
content. At the same time, I need to know how to insert/delete/edit content
in the GridView rows and then repopulate the xml source to reflect the
changes made in the gridView. Is there any simple examples of doing
something like this or can somebody create one for me?
Thanks for the help...
|
by: bala venkata siva ram kum |
last post by:
I am facing a problem while clicking edit button of a gridview.after clicking edit button it is displaying empty textboxes. I need old values in that textboxes.
Here i used 3-tier architecture. Below is my code:
/***Application layer***/
protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView2.EditIndex = e.NewEditIndex;
GridView2.DataSource =...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |