Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 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 March 26th, 2006, 08:30 PM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Calling Stored procedure in VB.NET

Please verify this code and let me know where i am going wrong.
when I am executing this code i am getting MCH3601 unmonitored by GETHAWB at statment 000000007. In stored procedure it is INPUT parm declaration statment.

Imports System.Data
Imports System.Data.Odbc

PublicClass Form1
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim HAWB AsChar = " RG150"
Dim HAWB1 As Odbc.OdbcParameter
Dim connString AsString = "DSN=EAGLE2; UID=XXXXX;PWD=XXXXXXX;"
Dim conn As OdbcConnection = New OdbcConnection(connString)
Dim cmd As OdbcCommand = conn.CreateCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "CALL EAFWPTSTPG.GETHAWB"
Dim dr As OdbcDataReader
Dim objParameter = New OdbcParameter()
HAWB1 = cmd.Parameters.Add("@HAWB1", Odbc.OdbcType.Char, 10)
HAWB1.Direction = ParameterDirection.Input
HAWB1.Value = HAWB

Try

conn.Open()
dr = cmd.ExecuteReader
If dr.HasRows Then
MsgBox("Data")
Else
MsgBox("No Data")
EndIf

Catch ex As Exception
MsgBox(ex.Message)
Finally
conn.Close()
EndTry

EndSub
EndClass

Thank you very much for the help

Krishna








Similar Threads
Thread Thread Starter Forum Replies Last Post
calling stored procedure jomet JSP Basics 0 November 23rd, 2007 08:06 AM
Calling Stored Procedure with parameters zarina_24 Classic ASP Professional 4 March 2nd, 2006 11:57 AM
VB calling DB2 stored procedure sangsri VB How-To 1 July 13th, 2005 08:55 AM
Calling AS/400 Stored Procedures from VB.NET prasanthknair ADO.NET 0 January 19th, 2005 06:55 AM
Calling a stored procedure in Crystal .net sureshbabu Crystal Reports 0 January 8th, 2005 05:32 AM





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