Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) 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 December 8th, 2003, 04:04 PM
Registered User
 
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dreamweaver MX2004 Datagrid update error

using DWMX2004 I have built a simple datagrid page, that connects to a sql2000 db.

The datagrid displays all of the information correctly, and will delete records as expected.
When I go to edit a record, all works as expected, until I go to update a record. Then I get the following error.

System.Data.SqlClient.SqlException: The variable name '@ProductID' has already been declared.


If anyone needs to see the code, I can post it for review to see if I am missing something, or have incorrectly added a field.


When I try comparing my code to the datagrid example from Macromedia, the example will not update a record either? Is there a bug in the dreamweaver controls for db updates within the datagrid?


Tim


http://www.cybernet-images.com
 
Old December 10th, 2003, 12:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Please post your Page_Load code or try this:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not IsPostBack Then
            objConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _
                            "data source=C:\Inetpub\wwwroot\asmain\dates.mdb")

            showDataGrid()
        Else
            objConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _
                            "data source=C:\Inetpub\wwwroot\asmain\dates.mdb")

        End If
    End Sub

showdatagrid() being the sub that displays data to the data grid control.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Dreamweaver error beetle_jaipur Dreamweaver (all versions) 0 May 3rd, 2006 07:06 AM
Datagrid.update() and DataAdapter.Update aarunlal ASP.NET 2.0 Professional 2 February 23rd, 2006 11:41 PM
Datagrid update error eresina ADO.NET 3 October 22nd, 2004 07:15 AM
Dreamweaver MX 2004 7.0.1 update scott_fegette Dreamweaver (all versions) 0 March 12th, 2004 05:01 PM
Date trouble using Dreamweaver Update Dirosky Dreamweaver (all versions) 2 January 8th, 2004 09:06 AM





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