Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
Register
| FAQ | Members List | 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
  #21 (permalink)  
Old November 15th, 2006, 11:10 AM
Authorized User
 
Join Date: Nov 2006
Location: Lorain, OH, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I received no results neither a value nor an exception. This tells me that the parameter is bad. I don't know how to fix it though because I swear I am doing it correctly. I am about to give up and just do it ado

Reply With Quote
  #22 (permalink)  
Old November 15th, 2006, 11:15 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

well.. print the parameter.. can you try it directly in the SP???

do something like this:

Code:
Public sub GetLevel5Manager(ByVal strCriteria As String) 
lblLevel5Manager.Text = Mid(strCriteria, 10, 8)
exit sub 
(the rest of the code...)
End sub
and then try that parameter in the SP..

HTH

Gonzalo
Reply With Quote
  #23 (permalink)  
Old November 15th, 2006, 03:31 PM
Authorized User
 
Join Date: Nov 2006
Location: Lorain, OH, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have given up. I have showed the code to some of the senior developers and they told me to do it ado. So that is what I am doing

Thank you so much for your hard work and I have another question

When doing this ado I need to know how to put the result of the commandtext into a the label. How would I do that?

Reply With Quote
  #24 (permalink)  
Old November 15th, 2006, 03:38 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

what do you mean by ado??

HTH

Gonzalo
Reply With Quote
  #25 (permalink)  
Old November 15th, 2006, 04:00 PM
Authorized User
 
Join Date: Nov 2006
Location: Lorain, OH, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ADO.NET is what I am referring to.

Reply With Quote
  #26 (permalink)  
Old November 15th, 2006, 04:06 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

mm.. we are inside .net... sorry but i don't understand, we were using ado.net...

HTH

Gonzalo
Reply With Quote
  #27 (permalink)  
Old November 15th, 2006, 04:11 PM
Authorized User
 
Join Date: Nov 2006
Location: Lorain, OH, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I must be the one confused sorry. I am using straight sql in the command text here is the code:

Code:
    Public Function GetLevel5Manager(ByRef strCriteria As String) As DataTable
        Try
            Dim strConn As String = HttpContext.Current.Session("ConnStr")
            Dim conn As New SqlConnection(strConn)
            Dim da As New SqlDataAdapter
            Dim ds As DataSet = New DataSet
            Dim cmd As SqlCommand
            Dim strCrit As String = Mid(strCriteria, 11, 7)

            conn.Open()
            cmd = conn.CreateCommand()
            With cmd
                .CommandText = "SELECT U.FullName FROM DropDownData D, Users U WHERE D.DropDownCategory = 'Level5' AND D.DisplayValue =' & strCrit & 'and D.Misc1 = U.Associate_ID"
                .CommandType = CommandType.Text
            End With

            da = New SqlDataAdapter(cmd)
            da.Fill(ds)

            lblLevel5Manager.Text = Convert.ToString(ds)

            conn.Close()

        Catch ex As Exception
            Dim sTemp As String
            sTemp = ex.Message
            lblLevel5Manager.Text = ex.Message

        End Try
    End Function
Reply With Quote
  #28 (permalink)  
Old November 15th, 2006, 04:17 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

ok ok :) glad you fix it... but it's dont understand why the sp doesn't work..

HTH

Gonzalo
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
how to see a label hombre Java Basics 3 March 4th, 2008 06:15 AM
Can I call a method that populate a Label??? cp75 ASP.NET 1.0 and 1.1 Basics 2 January 12th, 2007 05:39 AM
Dynamically displaying textboxes and label lily611 General .NET 1 December 15th, 2004 06:59 PM
Dynamically populate crystal report from .NET DTCT Crystal Reports 0 November 12th, 2004 11:46 AM



All times are GMT -4. The time now is 10:46 PM.


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