Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Editing/Deleting/Inserting Records using ASPxGridView

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WebGuy - 17 Oct 2007 10:56 GMT
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
Manish - 17 Oct 2007 11:41 GMT
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

> 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
[quoted text clipped - 8 lines]
>
> Shane

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.