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. Windows Forms
  4. import excel data from excel sheet to ms access database table

import excel data from excel sheet to ms access database table

Scheduled Pinned Locked Moved Windows Forms
helpcsharpdatabase
6 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.
  • N Offline
    N Offline
    Naresh123456789
    wrote on last edited by
    #1

    hi all, please help me in this problem.how can we import data from excel sheet to ms access database table .i am using c# windows application. thank you. regards obalesu n

    A 1 Reply Last reply
    0
    • N Naresh123456789

      hi all, please help me in this problem.how can we import data from excel sheet to ms access database table .i am using c# windows application. thank you. regards obalesu n

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      Access can import an excel spreadsheet directly, without using C#. If you go to the File/Get External Data/Import menu you will see that one of the file types is Excel. This is in Excel XP, I do not have Excel 2007 but I assume it will be the same. Hopefully this will solve your problem.

      Bob Ashfield Consultants Ltd

      N 1 Reply Last reply
      0
      • A Ashfield

        Access can import an excel spreadsheet directly, without using C#. If you go to the File/Get External Data/Import menu you will see that one of the file types is Excel. This is in Excel XP, I do not have Excel 2007 but I assume it will be the same. Hopefully this will solve your problem.

        Bob Ashfield Consultants Ltd

        N Offline
        N Offline
        Naresh123456789
        wrote on last edited by
        #3

        thank you. and i have faced another problem in my windows application(c#,ms access).i am using backend as ms access.i have written code like this. string s="datasource=C:\\cms\\cmsaccess.mdb"; string q="select * from users"; OledbConnection con=new OledbConnection(s); OledbDataAdapter adp=new OledbDataAdapter(q,con); DataSet ds=new DataSet(); adp.fill(ds,"users"); i have written like this in every form .but if i installed in server how the application access that database(C:\\cms\\cmsaccess.mdb) in clients .the database location may be changed in clients.i am facing this problem. this application must be run in network.please send solution for this problem. thank you regards obalesu n

        A 1 Reply Last reply
        0
        • N Naresh123456789

          thank you. and i have faced another problem in my windows application(c#,ms access).i am using backend as ms access.i have written code like this. string s="datasource=C:\\cms\\cmsaccess.mdb"; string q="select * from users"; OledbConnection con=new OledbConnection(s); OledbDataAdapter adp=new OledbDataAdapter(q,con); DataSet ds=new DataSet(); adp.fill(ds,"users"); i have written like this in every form .but if i installed in server how the application access that database(C:\\cms\\cmsaccess.mdb) in clients .the database location may be changed in clients.i am facing this problem. this application must be run in network.please send solution for this problem. thank you regards obalesu n

          A Offline
          A Offline
          Ashfield
          wrote on last edited by
          #4

          Put the mdb file on a network drive. Put the mdb file location in the app.config file, using a unc path - not 100% sure if a unc path will work, if not map a drive - google for net use Alternatively put the whole lot on the network and just give the users a shortcut You may experience performance problems if you have many users,Access is not designed to have lots of users, I would suggest if you are expecting more than about 10 or expect a lot of insert/update activity move to another type of database, for example sql server or mysql Hope this helps

          Bob Ashfield Consultants Ltd

          N 1 Reply Last reply
          0
          • A Ashfield

            Put the mdb file on a network drive. Put the mdb file location in the app.config file, using a unc path - not 100% sure if a unc path will work, if not map a drive - google for net use Alternatively put the whole lot on the network and just give the users a shortcut You may experience performance problems if you have many users,Access is not designed to have lots of users, I would suggest if you are expecting more than about 10 or expect a lot of insert/update activity move to another type of database, for example sql server or mysql Hope this helps

            Bob Ashfield Consultants Ltd

            N Offline
            N Offline
            Naresh123456789
            wrote on last edited by
            #5

            thanks for reply dear sir i don't have any idea about config file.and i wrote connectionstring as"datasource =C:\\cms\\cms.xls" .please send clearly idid't yet solve this problem. thank you regards obalesu

            A 1 Reply Last reply
            0
            • N Naresh123456789

              thanks for reply dear sir i don't have any idea about config file.and i wrote connectionstring as"datasource =C:\\cms\\cms.xls" .please send clearly idid't yet solve this problem. thank you regards obalesu

              A Offline
              A Offline
              Ashfield
              wrote on last edited by
              #6

              obalesu wrote:

              i don't have any idea about config file

              In which case try the C# help.

              obalesu wrote:

              i wrote connectionstring as"datasource =C:\\cms\\cms.xls"

              This will only work if your excel file is on your C drive. You said its on the network, so it won't work will it. I suggest you try a bit of Google research

              Bob Ashfield Consultants Ltd

              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