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. Reading DBF file....???- - - - Please help Me- - -

Reading DBF file....???- - - - Please help Me- - -

Scheduled Pinned Locked Moved C#
questionhelpcsharptutorial
7 Posts 5 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.
  • C Offline
    C Offline
    chester_it21
    wrote on last edited by
    #1

    dear all, i have question,about my code have problem.... how do I know if this dbf file or not, with a different extension, but it is a dbf file example: "12345.bck" file above is actually a dbf file, which just changed its extention. i am develop using C#.... please all,help me

    C M V A 4 Replies Last reply
    0
    • C chester_it21

      dear all, i have question,about my code have problem.... how do I know if this dbf file or not, with a different extension, but it is a dbf file example: "12345.bck" file above is actually a dbf file, which just changed its extention. i am develop using C#.... please all,help me

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

      I imagine if you try to connect to it as if it was a dbf file, you'd find out soon enough. Beyond that, you could look at the file format to see if there's some marker bytes you could read and examine.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      C 1 Reply Last reply
      0
      • C chester_it21

        dear all, i have question,about my code have problem.... how do I know if this dbf file or not, with a different extension, but it is a dbf file example: "12345.bck" file above is actually a dbf file, which just changed its extention. i am develop using C#.... please all,help me

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        As CG suggested connect to it and see if it fails. You can get connection information here[^]

        1 Reply Last reply
        0
        • C Christian Graus

          I imagine if you try to connect to it as if it was a dbf file, you'd find out soon enough. Beyond that, you could look at the file format to see if there's some marker bytes you could read and examine.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          C Offline
          C Offline
          chester_it21
          wrote on last edited by
          #4

          i am sory christian, I do not find your suggestion on the blog.. clearer please...

          C 1 Reply Last reply
          0
          • C chester_it21

            i am sory christian, I do not find your suggestion on the blog.. clearer please...

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

            I don't mention it on my blog, because it's not a bug in Microsoft. It's just common sense. I can't make it any clearer.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            1 Reply Last reply
            0
            • C chester_it21

              dear all, i have question,about my code have problem.... how do I know if this dbf file or not, with a different extension, but it is a dbf file example: "12345.bck" file above is actually a dbf file, which just changed its extention. i am develop using C#.... please all,help me

              V Offline
              V Offline
              vivasaayi
              wrote on last edited by
              #6

              If u are a guy like me, I would suggest you to visit http://www.clicketyclick.dk/databases/xbase/format/dbf.html#DBF_STRUCT[^] to know the structure of a Dbase file(".dbf"). Before making the connection, check the file by opening a streamreader, and check the first byte to find the version and do some other checks to confirm it is a valid dbf file.

              1 Reply Last reply
              0
              • C chester_it21

                dear all, i have question,about my code have problem.... how do I know if this dbf file or not, with a different extension, but it is a dbf file example: "12345.bck" file above is actually a dbf file, which just changed its extention. i am develop using C#.... please all,help me

                A Offline
                A Offline
                April Fans
                wrote on last edited by
                #7

                Hi, you can check the type of the file use: FileStream fs = new FileStream("Your file path", FileAccess.ReadWrite, FileMode.OpenOrCreate); StreamReader sr = new StreamReader(fs, Encoding.Default); sr.ReadToEnd(); sr.Close(); fs.Close(); or File.ReadAllLines("Your file path", Encoding.Default);

                April Comm100 - Leading Live Chat Software Provider

                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