p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Dreamweaver (all versions) (http://p2p.wrox.com/forumdisplay.php?f=58)
-   -   Dreamweaver MX2004 Datagrid update error (http://p2p.wrox.com/showthread.php?t=7011)

CyberNet99 December 8th, 2003 04:04 PM

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?



stu9820 December 10th, 2003 12:47 PM

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")

            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.

All times are GMT -4. The time now is 02:23 PM.

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