Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. (VB.NET)displaying row count in textbox using dataset

(VB.NET)displaying row count in textbox using dataset

Scheduled Pinned Locked Moved Visual Basic
csharpdatabase
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    venkata lakshmi prasanna
    wrote on last edited by
    #1

    in database primary key column is autonumber, if there are no records it should be displayed as 1 in textbox, if there records then it should display rows count+1 in textbox. please send using iif condition if possible. thank u

    T V 2 Replies Last reply
    0
    • V venkata lakshmi prasanna

      in database primary key column is autonumber, if there are no records it should be displayed as 1 in textbox, if there records then it should display rows count+1 in textbox. please send using iif condition if possible. thank u

      T Offline
      T Offline
      Tirthadip
      wrote on last edited by
      #2

      whatever your SQL command....just do the following after populating your dataset with existing record.... Dim Rowcount As Integer=Dataset1.Tables(0).Rows.Count TextBox1.Text=Rowcount+1

      Tirtha "A man can ride on your back only when it is bent....."

      1 Reply Last reply
      0
      • V venkata lakshmi prasanna

        in database primary key column is autonumber, if there are no records it should be displayed as 1 in textbox, if there records then it should display rows count+1 in textbox. please send using iif condition if possible. thank u

        V Offline
        V Offline
        venkata lakshmi prasanna
        wrote on last edited by
        #3

        if db is empty textbox1.text=1 else if db is having 3 records textbox1.text=ds.tables("emp").rows.count+1. how we can do this using if condition and as well as iif ternary operator. thank u

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups