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. Get data from Access instead of notepad (urgent)

Get data from Access instead of notepad (urgent)

Scheduled Pinned Locked Moved C#
helpdata-structuresquestion
5 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.
  • N Offline
    N Offline
    nidhelp
    wrote on last edited by
    #1

    Hi I want to get data from Access instead of notepad. Here are the codes to get data from notepad by entering IC number (equivalent to ID number). The records are stored in 'Folder'. public void btnGo_Click_1(object sender, System.EventArgs e)// -->User can select the file by entering the IC Nunber in textbox and program will check for file existence and null file { enable(); /** [Retrieve IC Number from tboxEnterICNo] **/ strFileName2 = tboxEnterICNo.Text; path = @"Folder\"+strFileName2+".txt"; /** [Check for file existence] **/ if(File.Exists("Folder\\"+strFileName2+".txt"))// -->If file exists, open DisplayGraph form and display the graph { displaygraph.names = path;// -->copies the path to DisplayGraph form displaygraph.ShowDialog();// -->Opens DisplayGraph form to display graph }//End of if-condition else { MessageBox.Show("File does not exist! Please create a new profile.", "Invalid File Type", MessageBoxButtons.OK, MessageBoxIcon.Error ); }// -->End of else-condition }// -->End of btnGo_Clicks module How should i go about to keep the records in Access and also specify retrieving of the queried data from an Access table instead? I need some help about what to do and how the codes look like. Thank you very much! :)

    C E 2 Replies Last reply
    0
    • N nidhelp

      Hi I want to get data from Access instead of notepad. Here are the codes to get data from notepad by entering IC number (equivalent to ID number). The records are stored in 'Folder'. public void btnGo_Click_1(object sender, System.EventArgs e)// -->User can select the file by entering the IC Nunber in textbox and program will check for file existence and null file { enable(); /** [Retrieve IC Number from tboxEnterICNo] **/ strFileName2 = tboxEnterICNo.Text; path = @"Folder\"+strFileName2+".txt"; /** [Check for file existence] **/ if(File.Exists("Folder\\"+strFileName2+".txt"))// -->If file exists, open DisplayGraph form and display the graph { displaygraph.names = path;// -->copies the path to DisplayGraph form displaygraph.ShowDialog();// -->Opens DisplayGraph form to display graph }//End of if-condition else { MessageBox.Show("File does not exist! Please create a new profile.", "Invalid File Type", MessageBoxButtons.OK, MessageBoxIcon.Error ); }// -->End of else-condition }// -->End of btnGo_Clicks module How should i go about to keep the records in Access and also specify retrieving of the queried data from an Access table instead? I need some help about what to do and how the codes look like. Thank you very much! :)

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

      You've been loading text files, and you want to move to an Access DB ? If you google[^] C# Access Database, you get heaps of links to articles on this sort of thing. Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • N nidhelp

        Hi I want to get data from Access instead of notepad. Here are the codes to get data from notepad by entering IC number (equivalent to ID number). The records are stored in 'Folder'. public void btnGo_Click_1(object sender, System.EventArgs e)// -->User can select the file by entering the IC Nunber in textbox and program will check for file existence and null file { enable(); /** [Retrieve IC Number from tboxEnterICNo] **/ strFileName2 = tboxEnterICNo.Text; path = @"Folder\"+strFileName2+".txt"; /** [Check for file existence] **/ if(File.Exists("Folder\\"+strFileName2+".txt"))// -->If file exists, open DisplayGraph form and display the graph { displaygraph.names = path;// -->copies the path to DisplayGraph form displaygraph.ShowDialog();// -->Opens DisplayGraph form to display graph }//End of if-condition else { MessageBox.Show("File does not exist! Please create a new profile.", "Invalid File Type", MessageBoxButtons.OK, MessageBoxIcon.Error ); }// -->End of else-condition }// -->End of btnGo_Clicks module How should i go about to keep the records in Access and also specify retrieving of the queried data from an Access table instead? I need some help about what to do and how the codes look like. Thank you very much! :)

        E Offline
        E Offline
        enjoycrack
        wrote on last edited by
        #3

        hi there, if u need to keep the records in Access DB, u need to have basic knowledge of mechanism of accessing to Access DB, such as: ODBC, OleDB, ADO or ADO.NET. u can get more detail and also simple codes from MSDN To query from Access DB, u also need to know SQL query. This can be got from SQL Book Online << >>

        N 1 Reply Last reply
        0
        • E enjoycrack

          hi there, if u need to keep the records in Access DB, u need to have basic knowledge of mechanism of accessing to Access DB, such as: ODBC, OleDB, ADO or ADO.NET. u can get more detail and also simple codes from MSDN To query from Access DB, u also need to know SQL query. This can be got from SQL Book Online << >>

          N Offline
          N Offline
          nidhelp
          wrote on last edited by
          #4

          Hi hi, If it's using oledbadapter and dataset, i know how to use them and query for data from Access. However, what i need now is how do i automatically store the data downloaded into Access instead of storing in Notepad? How do i get every set of downloaded data to append to my Access db table?? Thank you!!

          E 1 Reply Last reply
          0
          • N nidhelp

            Hi hi, If it's using oledbadapter and dataset, i know how to use them and query for data from Access. However, what i need now is how do i automatically store the data downloaded into Access instead of storing in Notepad? How do i get every set of downloaded data to append to my Access db table?? Thank you!!

            E Offline
            E Offline
            enjoycrack
            wrote on last edited by
            #5

            after u downloaded data need to be stored into Access DB, u can use sql query that is something like "insert into ur table(field1, field2,..) values (...)" to insert the data into Access DB << >>

            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