Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 17th, 2007, 04:26 PM
Authorized User
 
Join Date: Oct 2006
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old December 17th, 2007, 04:30 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
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
================================================== =========
Reply With Quote
  #3 (permalink)  
Old December 17th, 2007, 04:35 PM
Authorized User
 
Join Date: Oct 2006
Location: , , .
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old December 17th, 2007, 05:21 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
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
================================================== =========
Reply With Quote
  #5 (permalink)  
Old December 17th, 2007, 05:46 PM
Authorized User
 
Join Date: Oct 2006
Location: , , .
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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:26 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.