Hello,
The following code is updateing database . i am using stored procedure for updating database.
It does't show any error but it is not updateing datasource.
Stored procedure.
ET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER Proc dbo.InGpFilter
@Finame Varchar(25)
As
Declare @Finameid int
Set @Finameid = dbo.Getnewid(getdate())
Insert into GpFilter (FiName,FiNameid) values (@Finame,@Finameid)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
Update code
Private Sub UpdateRecord()
Try
Dim mycnn As New SqlConnection(ConnectionString)
dap1 = New SqlDataAdapter()
Dim cmdup As New SqlCommand()
With cmdup
.CommandType = CommandType.StoredProcedure
.CommandText = "UpGpFilter"
.Connection = mycnn
.Parameters.Add("@Finame", SqlDbType.VarChar, 25, "Finame")
Dim prm1 As SqlParameter = cmdup.Parameters.Add("@Finameid", SqlDbType.Int)
prm1.SourceColumn = "Finameid"
prm1.SourceVersion = DataRowVersion.Original
End With
mycnn.Open()
dap1.UpdateCommand = cmdup
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")
Finally
End Try
End Sub
what is wrong with this.
Thanking you,
Mufi
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only