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. C#
  4. looping

looping

Scheduled Pinned Locked Moved C#
csharptutorial
4 Posts 3 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.
  • L Offline
    L Offline
    Lucky Sheikh
    wrote on last edited by
    #1

    how to loop the label or textid in C#.net as per vb textboxname.text=cmd.executescalar() but it,s not working in c#.net anyone tell me the suggestion now lucky

    C I 2 Replies Last reply
    0
    • L Lucky Sheikh

      how to loop the label or textid in C#.net as per vb textboxname.text=cmd.executescalar() but it,s not working in c#.net anyone tell me the suggestion now lucky

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Lucky Sheikh wrote:

      how to loop the label or textid in C#.net as per vb textboxname.text=cmd.executescalar() but it,s not working in c#.net anyone tell me the suggestion now

      What do you mean "loop the label or textid"? The code you have written puts the value of the first column of the first row in the Text property of the text box. It won't loop over anything.


      Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

      1 Reply Last reply
      0
      • L Lucky Sheikh

        how to loop the label or textid in C#.net as per vb textboxname.text=cmd.executescalar() but it,s not working in c#.net anyone tell me the suggestion now lucky

        I Offline
        I Offline
        Imran Khan Pathan
        wrote on last edited by
        #3

        textboxname.text=cmd.executescalar() ExecuteScalar returns object. You assigned this object to var string so that u r getting error here try this code textboxname.text=cmd.executescalar().ToString(); Best Regard Pathan

        ---------------------------------------------------

        C 1 Reply Last reply
        0
        • I Imran Khan Pathan

          textboxname.text=cmd.executescalar() ExecuteScalar returns object. You assigned this object to var string so that u r getting error here try this code textboxname.text=cmd.executescalar().ToString(); Best Regard Pathan

          ---------------------------------------------------

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          Imran Khan Pathan wrote:

          textboxname.text=cmd.executescalar().ToString();

          And if the result set contains zero rows this will fail also.


          Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

          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