Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.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 March 25th, 2006, 03:05 AM
Registered User
 
Join Date: Mar 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update requires a valid InsertCommand when ...

I get this error message when I am trying to update multiple fields in my database:

Update requires a valid InsertCommand when passed DataRow collection with new rows.

This is my code:

Code:
' Finding the row i want to alter
For i = 0 To ds.Tables("table1").Rows.Count - 1
                    If ds.Tables("table1").Rows(i)(22).ToString = Request.QueryString("ID").ToString Then
                        For ii = 0 To 5
                            ds.Tables("table1").Rows(i)(ii) = "change"
                        Next
                    End If
                Next
                sqlCmd.UpdateCommand = New SqlCommand()
                sqlCmd.UpdateCommand.CommandText = "Update " & Session("table").ToString & " Set Date='" & dateMM.SelectedItem.Text & "/" & dateDD.SelectedItem.Text & "/" & dateYY.SelectedItem.Text & "',[Course Name]='" & CourseName.Text & "',Hole1='" & scoreinfo(0) & "',Hole2='" & scoreinfo(1) & "',Hole3='" & scoreinfo(2) & "',Hole4='" & scoreinfo(3) & " Where RoundID=" & Request.QueryString("ID").ToString
                sqlCmd.UpdateCommand.Connection = SqlConn
                sqlCmd.Update(ds, "table1")







Similar Threads
Thread Thread Starter Forum Replies Last Post
InsertCommand DetailsView nols BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 November 3rd, 2007 06:36 AM
Beginner requires a little help!? Koko Brown Flash (all versions) 2 August 16th, 2007 01:45 AM
Error: Update requires a valid InsertCommand ... spiffyaldo2 ASP.NET 2.0 Basics 3 March 27th, 2006 02:24 AM
Error: Update requires a valid InsertCommand... spiffyaldo2 ASP.NET 1.0 and 1.1 Basics 0 March 25th, 2006 02:28 PM
MySql .NET Provider Update/InsertCommand lifewarped ADO.NET 1 February 22nd, 2005 12:59 PM





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