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. having problem with Access database

having problem with Access database

Scheduled Pinned Locked Moved C#
csharpdatabasehelpquestion
4 Posts 4 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.
  • U Offline
    U Offline
    User 2304497
    wrote on last edited by
    #1

    This is my code in C#.The database i am trying to access is having 49 entries in NotesdataTable sequentially(1 to 49).When i check ,i get the entry at first row, first column as 23 when the expected one is 1. string s=""; int i,j; string path=Application.StartupPath; conn=new OleDbConnection("FILE NAME="+path+"\\itskiosk.udl"); adpt=new OleDbDataAdapter("Select * from NotesDataTable",conn); DataSet dataset=new DataSet(); adpt.Fill(dataset,"NotesDataTable"); MessageBox.Show(dataset.Tables["NotesDataTable"].Rows[0][0].ToString()); What is the problem. If any body has any idea pl let me know. Thank you. world of intelegence

    E V 2 Replies Last reply
    0
    • U User 2304497

      This is my code in C#.The database i am trying to access is having 49 entries in NotesdataTable sequentially(1 to 49).When i check ,i get the entry at first row, first column as 23 when the expected one is 1. string s=""; int i,j; string path=Application.StartupPath; conn=new OleDbConnection("FILE NAME="+path+"\\itskiosk.udl"); adpt=new OleDbDataAdapter("Select * from NotesDataTable",conn); DataSet dataset=new DataSet(); adpt.Fill(dataset,"NotesDataTable"); MessageBox.Show(dataset.Tables["NotesDataTable"].Rows[0][0].ToString()); What is the problem. If any body has any idea pl let me know. Thank you. world of intelegence

      E Offline
      E Offline
      ehuysamer
      wrote on last edited by
      #2

      Try adding "ORDER BY [Column]" to your select statement

      A 1 Reply Last reply
      0
      • E ehuysamer

        Try adding "ORDER BY [Column]" to your select statement

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        tahnks it is working properly know

        1 Reply Last reply
        0
        • U User 2304497

          This is my code in C#.The database i am trying to access is having 49 entries in NotesdataTable sequentially(1 to 49).When i check ,i get the entry at first row, first column as 23 when the expected one is 1. string s=""; int i,j; string path=Application.StartupPath; conn=new OleDbConnection("FILE NAME="+path+"\\itskiosk.udl"); adpt=new OleDbDataAdapter("Select * from NotesDataTable",conn); DataSet dataset=new DataSet(); adpt.Fill(dataset,"NotesDataTable"); MessageBox.Show(dataset.Tables["NotesDataTable"].Rows[0][0].ToString()); What is the problem. If any body has any idea pl let me know. Thank you. world of intelegence

          V Offline
          V Offline
          Venkat6070
          wrote on last edited by
          #4

          check the table name that u have mentioned in C# code with the one u created in Database. I observed a mismatch between those two from ur query. u might have done... NotesdataTable in Database NotesDataTable in C# code. check it venkat

          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