Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating record
Message
De
18/07/2003 15:17:44
 
 
À
18/07/2003 14:29:01
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Divers
Thread ID:
00810009
Message ID:
00811635
Vues:
13
Mufi,

One thing you can try it to look at SQL Profiler and see exactly what commands are being sent to the backend when you try to update your table.

~~Bonnie


>SQL PROCEDURE
>
>
>SET QUOTED_IDENTIFIER ON
>GO
>SET ANSI_NULLS ON
>GO
>
>ALTER  Proc UpGpFilter
>@Finame varchar(25)= null,
>@Finameid int
>AS
>Update GpFilter
>
>Set Finame = @Finame
>Where
>Finameid = @Finameid
>
>GO
>SET QUOTED_IDENTIFIER OFF
>GO
>SET ANSI_NULLS ON
>GO
>
>
>
>
>
>
>VB.NET CODE
>
>Private Sub UpdateRecord()
>        Try
>            Dim mycnn As New SqlConnection(ConnectionString)
>            dap1.UpdateCommand = New SqlCommand("UpGpFilter", mycnn)
>            With dap1.UpdateCommand
>                .CommandType = CommandType.StoredProcedure
>                .Parameters.Add("@Finame", SqlDbType.VarChar, 25, "Finame")
>                Dim prm1 As SqlParameter = dap1.UpdateCommand.Parameters.Add("@Finameid", SqlDbType.Int)
>                prm1.SourceColumn = "Finameid"
>                prm1.SourceVersion = DataRowVersion.Original
>            End With
>
>            mycnn.Open()
>            myds.GpFilter.GetChanges(DataRowState.Modified)
>            dap1.Update(myds, "GpFilter")
>            mycnn.Close()
>
>        Catch ex As SqlException
>            MsgBox(ex.Message, MsgBoxStyle.Critical, "SQL ERROR")
>
>        Catch ex As Exception
>            MsgBox(ex.Message, MsgBoxStyle.Critical, "General Error")
>
>        End Try
>
>    End Sub
>
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform