locked
Convert Integer to string within a gridview on webpage RRS feed

  • Question

  • I have created a webpage that has a gridview attached to a sql database with employee names and Jurisdictions the employees are in.  The jurisdiction column is an integer with numbers 1 through 99.  I want to convert the numbers 1 and 99 so they show in the gridview as  1 would convert to "Police" and 99 would convert to  "Dispatch" within the gridview.  I am new using Visual Basic and not sure how to write this.  I have tried multiple different ways but nothing is converting the numbers to text.  The below code is just the gridview, no code to convert int to string.  I am not even sure If I am putting it in the right place within the basic code.
    Public Class employeesearchform
        Inherits System.Web.UI.Page
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
        End Sub
    
        Protected Sub GridView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles GridView1.SelectedIndexChanged
    
        End Sub
    End Class


    • Edited by wgraulich Thursday, July 30, 2020 5:06 PM
    Thursday, July 30, 2020 5:04 PM

Answers

  • Isn't this VB script and then shouldn't it be in this section
    This is VB.NET, not VB script forum.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by wgraulich Thursday, July 30, 2020 9:11 PM
    Thursday, July 30, 2020 8:27 PM

All replies

  • You should ask in the link below

    https://forums.asp.net/18.aspx/1?Web+Forms


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, July 30, 2020 7:55 PM
  • Isn't this VB script and then shouldn't it be in this section
    Thursday, July 30, 2020 8:06 PM
  • Isn't this VB script and then shouldn't it be in this section
    This is VB.NET, not VB script forum.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by wgraulich Thursday, July 30, 2020 9:11 PM
    Thursday, July 30, 2020 8:27 PM