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 November 15th, 2006, 11:10 AM
Authorized User
 
Join Date: Nov 2006
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

 
Old November 15th, 2006, 11:15 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old November 15th, 2006, 03:31 PM
Authorized User
 
Join Date: Nov 2006
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?

 
Old November 15th, 2006, 03:38 PM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old November 15th, 2006, 04:00 PM
Authorized User
 
Join Date: Nov 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ADO.NET is what I am referring to.

 
Old November 15th, 2006, 04:06 PM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old November 15th, 2006, 04:11 PM
Authorized User
 
Join Date: Nov 2006
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
 
Old November 15th, 2006, 04:17 PM
Friend of Wrox
 
Join Date: Jun 2003
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





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





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