Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 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 February 20th, 2006, 02:22 PM
Registered User
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to insert multiple paramater on oledbdataadpat

Hi There,
I'm using Visual basic .net form to send in retrieve information from my access table.
I have created a oledbdataadapter with the following query

SELECT [WO #], [Dash #], Req AS [Order DT], Approved, Code, [Item#], Cus, ID
FROM Approve
WHERE ([WO #] between ? and ?)

I want to be able to input a Wo # between a range like between 13500 to 13600 etc.
I have two text box in my form and a button . Please find my code to the onclick event of the button.
I want to be able to pass the wo# from two text box.
I would appreciate if somebody can tell me how I could do this.

Private Sub ORDBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ORDBTN.Click
        Try
            OleDbDataAdapter1.SelectCommand.Parameters("WO__") .Value = OTBOX.Text
' somehow want to be able to send the second value for WO USING OTEND.TEXT( thats my second text box)
            FnApp()
        Catch ex As Exception
            MsgBox(ex.Message + vbCrLf + ex.Source & vbCrLf & vbCrLf & ex.StackTrace, MsgBoxStyle.Critical, "Error")
        End Try
    End Sub
 
Old September 19th, 2006, 09:14 AM
Authorized User
 
Join Date: Aug 2006
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to amit_mande@yahoo.com Send a message via AIM to amit_mande@yahoo.com Send a message via MSN to amit_mande@yahoo.com Send a message via Yahoo to amit_mande@yahoo.com
Default

I may be wrong but try this

u have to use oledbCommand object(let myCommand) then add following code

myCommand.Parameters.Add("@a",TextBox1.text)
myCommand.Parameters.Add("@b",TextBox2.text)

now in ur select code instead of using ? mark use @a and @b.
where @a,@b r placeholders







Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with date paramater gregalb Reporting Services 1 January 15th, 2008 03:55 AM
Multiple Insert tsimsha Classic ASP Basics 1 January 19th, 2005 07:48 AM
Insert multiple records mateenmohd Access 13 November 2nd, 2004 09:15 AM
Multiple Insert.....any ideas? Seb_soum Classic ASP Databases 2 May 25th, 2004 03:43 PM
Multiple value insert mateenmohd SQL Server 2000 3 October 7th, 2003 12:55 AM





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