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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. asp.net - Please clear my dought

asp.net - Please clear my dought

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminhelptutorial
3 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.
  • A Offline
    A Offline
    abglorie
    wrote on last edited by
    #1

    Please help me. I creat a form like this label_1 as display the employee ID textbox_1 as employee address Now I want update the address I writing a coding like this dim con as sqlconnection(connectionstring) dim cmd as sqlcommand("select empID from Employee", con) dim adapter as sqldataadapter(cmd) dim ds as new dataset try if session("ds") is nothing then con.open() adapter.fill(ds,"Employee") session("ds") = ds endif finally con.close() endtry My form is asp:label id=label_1 text = "<%=session("ds")("EmpID")%>" runat="server" .... I need how to display emplyee ID (EmpID) into the form as label_1 this action continue the button click the next employee ID display the Label_1 upto end of table. (assume the table contain 20 records) I try the session state but not working. Please give me actual coding in VB format. Thanking you in advance abglorie

    N C 2 Replies Last reply
    0
    • A abglorie

      Please help me. I creat a form like this label_1 as display the employee ID textbox_1 as employee address Now I want update the address I writing a coding like this dim con as sqlconnection(connectionstring) dim cmd as sqlcommand("select empID from Employee", con) dim adapter as sqldataadapter(cmd) dim ds as new dataset try if session("ds") is nothing then con.open() adapter.fill(ds,"Employee") session("ds") = ds endif finally con.close() endtry My form is asp:label id=label_1 text = "<%=session("ds")("EmpID")%>" runat="server" .... I need how to display emplyee ID (EmpID) into the form as label_1 this action continue the button click the next employee ID display the Label_1 upto end of table. (assume the table contain 20 records) I try the session state but not working. Please give me actual coding in VB format. Thanking you in advance abglorie

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      abglorie wrote:

      dim con as sqlconnection(connectionstring)

      I am not much familiar to VB. but this line looks incorrect. Becuse SQLConnection is not instantiated using new keyword.

      abglorie wrote:

      asp:label id=label_1 text = "<%=session("ds")("EmpID")%>" runat="server"

      This is a server control. So you can access it from the code behind file instead of writing this. To move to next record in the dataset, you need to maintain current position somewhere. When button is clicked, take this value and move to the next record.


      My Website | Ask smart questions

      1 Reply Last reply
      0
      • A abglorie

        Please help me. I creat a form like this label_1 as display the employee ID textbox_1 as employee address Now I want update the address I writing a coding like this dim con as sqlconnection(connectionstring) dim cmd as sqlcommand("select empID from Employee", con) dim adapter as sqldataadapter(cmd) dim ds as new dataset try if session("ds") is nothing then con.open() adapter.fill(ds,"Employee") session("ds") = ds endif finally con.close() endtry My form is asp:label id=label_1 text = "<%=session("ds")("EmpID")%>" runat="server" .... I need how to display emplyee ID (EmpID) into the form as label_1 this action continue the button click the next employee ID display the Label_1 upto end of table. (assume the table contain 20 records) I try the session state but not working. Please give me actual coding in VB format. Thanking you in advance abglorie

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        abglorie wrote:

        I try the session state but not working.

        I doubt that. Looks like you're storing the dataset in the session, that will work just fine. It obviously won't display anything, and is a waste of time if you don't need this data on another page. ds.Tables(0).Rows(0)("id") should work, assuming hte column name is id. I recommend reading a book on ADO.NET so you can do this without just stabbing blindly at it.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        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