Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating record
Message
From
14/07/2003 17:02:42
 
 
To
All
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Updating record
Miscellaneous
Thread ID:
00810009
Message ID:
00810009
Views:
47
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
Map
View

Click here to load this message in the networking platform