Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 31st, 2007, 10:30 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Default @ parameter1 not a parameter in store procedure

I am using the .NET Framework Call <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="displayPPDataInformation" insertmethod="InsertUpdatePPDataInformation" TypeName="cls_RegFrmPPComponent" DataObjectTypeName="cls_RegFrmPP" >
       <SelectParameters>
           <asp:Parameter Name="ppID" Type="Int32" />
       </SelectParameters>
  but in my DB class it gives me the error @ paramter1 not a parameter in store proc it gives error
 Dim rowsAffected As Integer = 0
        DBConn.Open()

        Try
            rowsAffected = DBCommand.ExecuteNonQuery
                  Catch ex As Exception
            Throw New Exception("Item not updated")
        Finally
            DBConn.Close()
        End Try

 
Old June 1st, 2007, 04:32 AM
Registered User
 
Join Date: Mar 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
i am not sure how ur coding work. but u can try below coding to call a store procedure and pass a value to SP and navigate with DB.

hope can help u

Dim sqlcmd As New SqlCommand()
Dim sqlDa As New SqlDataAdapter()
sqlConn.Open()

sqlcmd = New SqlCommand("StoreProcedure name", sqlConn, RollBackAction)
sqlDa.SelectCommand = sqlcmd
sqlcmd.CommandType = CommandType.StoredProcedure
sqlcmd.CommandTimeout = 2000

sqlcmd.Parameters.Add("@parameter", SqlDbType.VarChar, 30).Value = value
 sqlcmd.ExecuteNonQuery()
sqlConn.Close()
sqlConn.Dispose()

http://programmingschools.blogspot.com/
http://sqltutorials.blogspot.com/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Store procedure help... RinoDM SQL Server 2000 7 August 11th, 2008 07:09 PM
Store procedure help ??? RinoDM SQL Server 2000 8 May 1st, 2008 03:03 PM
Store Procedure sureshyuga SQL Server 2000 0 May 18th, 2007 01:49 AM
How to Store Literal Value in Variable/Parameter kwilliams XSLT 5 August 31st, 2005 08:52 AM
Pass parameter to store procedure & Crystal Report quinn Classic ASP Professional 0 March 10th, 2004 02:16 PM





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