Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating record
Message
From
15/07/2003 03:08:50
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
14/07/2003 17:02:42
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Miscellaneous
Thread ID:
00810009
Message ID:
00810096
Views:
13
>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

Mufi,

If possible, can you please post the complete, unaltered code? The code you have posted will not compile as-is.

P.S. You can use the "<"PRE">" and "<"/PRE">" tags to copy-and-paste code directly from your source files (omit the quotes).

It has been my experience that when something ought to work and doesn't, the problem usually lies somewhere unexpected. It might help to comment out the Try..Catch construct and let .NET give you the complete error message and source file line number.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform