Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
|
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 2nd, 2005, 11:57 PM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default SqlDatasource DeleteCommand gving error

I am using SqlDatasource with GridView & DetailView to Insert,Edit & delete a table data (All commands (select,update,insert & delete) are dynamicaly generated & set in runtime ).

I am connected to authores in pubs.
Select,insert & update commands are working fine, but the Delete Command giving error "cannot find the @au_id ..."?

I am using "DELETE From Authors WHERE auid=@auid "

 
Old May 3rd, 2005, 06:36 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think i got the problem, I have to set the DataKeyNames.






 
Old May 4th, 2005, 11:29 PM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Still the issue persists, If I hardcode DataKeyNames in the HTML attribute i works , but i want to set in runtime from the code behind. This way it gives lots of errors like "Index not ...."

Any one to help!

Thanks in advance
Prashant





Similar Threads
Thread Thread Starter Forum Replies Last Post
sqldatasource imjayakumar ASP.NET 2.0 Professional 3 May 21st, 2007 01:56 PM
SqlDataSource control error binici ASP.NET 2.0 Basics 1 January 19th, 2007 08:02 PM
SqlDataSource - Error Handling? RobC ASP.NET 2.0 Basics 5 September 25th, 2006 11:51 AM
deletecommand in the datagrid jwyw0813 ASP.NET 2.0 Professional 6 March 2nd, 2006 02:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.