Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Editing/Deleting/Inserting Records using ASPxGridView

Reply
Thread Tools

Editing/Deleting/Inserting Records using ASPxGridView

 
 
WebGuy
Guest
Posts: n/a
 
      10-17-2007
I'm using Visual Studio 2005 and SQL Server 2005, and I've created an
AJAXenabled ASPx.Net Website. In one of my SQL Server tables, I have Social
Security Number as my PrimaryKey, and I'm using this field as a Seach
parameter in my WebForm. My question is this ... Is it necessary to display
the PrimaryKey in the ASPxGridView in order for you to be able to
Edit/Update a record? When I include the PrimaryKey field in the
ASPxGridView, I can Edit/Delete records, but if I don't include the
PrimaryKey (or set it to Visible=False) then I can't Edit/Delete records.

Thanks in advance for any advice/assistance offered.

Shane


 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWFuaXNo?=
Guest
Posts: n/a
 
      10-17-2007
Hi,

You can delete the records from the GridView even if you do not specify any
Primary key in your Table but in that case your delete query would not be
automatically generated by the sqldatasource.

You will have to write your query yourself in the deleteQuery in the
SQLDataSource and specify the DataKeyName property of the GridView to be one
of the column of the table on the basis of which the row would be deleted
from the table.

Regards,
Manish



"WebGuy" wrote:

> I'm using Visual Studio 2005 and SQL Server 2005, and I've created an
> AJAXenabled ASPx.Net Website. In one of my SQL Server tables, I have Social
> Security Number as my PrimaryKey, and I'm using this field as a Seach
> parameter in my WebForm. My question is this ... Is it necessary to display
> the PrimaryKey in the ASPxGridView in order for you to be able to
> Edit/Update a record? When I include the PrimaryKey field in the
> ASPxGridView, I can Edit/Delete records, but if I don't include the
> PrimaryKey (or set it to Visible=False) then I can't Edit/Delete records.
>
> Thanks in advance for any advice/assistance offered.
>
> Shane
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing/Deleting/Inserting Records using ASPxGridView WebGuy ASP .Net Web Controls 1 10-17-2007 10:41 AM
Simple query returns 0 records in asp, but all records in vbscript masg0013@gmail.com ASP General 3 11-02-2006 09:23 AM
Delete records or update records Dan ASP General 1 05-10-2004 01:25 PM
match muliple header records to associated detail records Luke Airig XML 0 12-31-2003 12:06 AM
Can't generate start records for commands accounting using TACACS+ iwolf Cisco 2 11-11-2003 03:40 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57