Wrox Programmer Forums
|
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 December 17th, 2007, 04:26 PM
Authorized User
 
Join Date: Oct 2006
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default ids

I’m gonna try my best to explain to you what’s happening. I have this page where a user can assign multiple ids by entering a beginning and ending number. If they enter 1 as the beginning number and 15 as the ending, ids 1 thru 15 will be assigned. I have it to where it checks whether or not it’s duplicate, which is working. Thing is I’m trying to get where I could select which id is duplicate and display a message label or something to let the user know which one it is. Whether it’s id 1, 2, 15, 18. Am I making sense?


Sub CheckDuplicatePassNumber()
        'Sub proc that checks to see if pass number has been assigned

        'Production connection

        Dim objDataReader As SqlDataReader
        Dim cmdChkDuplicate As New SqlCommand("spAAPCheckMultipleDuplicatePassNumber" , connAAP)
        cmdChkDuplicate.CommandType = CommandType.StoredProcedure

        'Checks to pass number has already been assigned
        'Declare parameters to send to the stored proc
        With cmdChkDuplicate.Parameters
            .Add("@vchAAPNumber2", txtBeginNum.Text)
            .Add("@vchEndAAP", txtEndNum.Text)
        End With

        connAAP.Open()
        objDataReader = cmdChkDuplicate.ExecuteReader()

        Do While objDataReader.Read()
            intcount += 1
        Loop

        objDataReader.Close()
        connAAP.Close()
    End Sub

 
Old December 17th, 2007, 04:30 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Why not pass the dupes back from the store procedure and write the contents of your data reader out to the screen?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old December 17th, 2007, 04:35 PM
Authorized User
 
Join Date: Oct 2006
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't understand what you mean. Could you give me an example?

 
Old December 17th, 2007, 05:21 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

SELECT id from <table> where id between @vchAAPNumber2 and @vchEndAAP

This will either return 0 results (no dupes) or return ids that already exsist and those would be your dupes.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old December 17th, 2007, 05:46 PM
Authorized User
 
Join Date: Oct 2006
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

looks good to me. I'm about to leave work but I will most definitely try it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Email IDs rohit_ghosh Excel VBA 2 July 16th, 2007 03:57 PM
Dialog Help Ids sumeetpm Visual C++ 0 October 31st, 2006 03:19 PM
Duplicating IDs in database pettrer ASP.NET 2.0 Basics 7 July 8th, 2006 04:03 PM
Ints or Unique IDs? pettrer ASP.NET 2.0 Basics 3 June 5th, 2006 08:28 PM
Ids problem on subform ailyn Access VBA 1 December 9th, 2005 05:30 PM





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