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. General Programming
  3. C#
  4. Help ! Database Problem, Unknown Information in an Access DataBase by the MEMO type! [modified]

Help ! Database Problem, Unknown Information in an Access DataBase by the MEMO type! [modified]

Scheduled Pinned Locked Moved C#
helphtmlmobiledatabasecom
13 Posts 2 Posters 1 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.
  • M maysam gamini

    Hi friends. there is a clinic software who was written by a bankrupted company, and now it doesn’t work by the some reason, and there is no support on this software, All things that I have to do are recover the patient’s data that was written by doctor handwriting in his notebook tablet-pc. let me describe a little... software has a feature that allow to the doctor to write the patients information by hand writing with an electrical pen, it so like paint brush software and it save this information in the database like bellow...

    AIfIAR0E2A/uBgIZAkgRBUgRRP8BBEgQRTUKSBFXDQAAAFD/AQQDATgAGCIgMgkA9P8CAekiOkUzCQD4nwIBWiA6RTgIAP4DAAAAgH8ADw4S+SONP88jjT8RAACAPx4+4gKD/glK/glJAAAAAAAAAAAYyAAAAAAAAAAAAAAAAAiQIkAAAAAAVMgAAAAESAEJAAAAAAxkAAAAAAIfEAAKLw+E+44+492VloilKFtOjSCG4PDhA6KAjpKCkI

    i found that, it's definitely a String Base 64, 'cause I was able to build a byte array from it with this code:

    string strData = dataGridView1[2, 0].Value.ToString();//this from visit table in sample database that i //attached
    byte[] data = Convert.FromBase64String(strData);

    and then i use this :

    public Image ByteToImageConvert(byte[] byteArrayIn)
    {
    MemoryStream ms = new MemoryStream(byteArrayIn);
    Image returnImage = Image.FromStream(ms);
    return returnImage;
    }

    but i face with this problem on " Image returnImage = Image.FromStream(ms);": Parameter is not valid. So What should i do? i attached the database file here/: http://rapidshare.com/files/302706380/test.accdb.html there is a tables in the database, and all thing that i need is the "VISIT Table" 's information on the column by the name "NOTES", i think it must be image. HELP ME,THis IS UrGENT Problem! thank you very much! With best Regards!

    modified on Thursday, November 5, 2009 7:36 PM

    M Offline
    M Offline
    maysam gamini
    wrote on last edited by
    #4

    Dear Friends, Well i found that, it's definitely a String Base 64, 'cause I was able to build a byte array from it with this code:

    string strData = dataGridView1[2, 0].Value.ToString();//this from visit table in sample database that i //attached
    byte[] data = Convert.FromBase64String(strData);

    and i use this :

    public Image ByteToImageConvert(byte[] byteArrayIn)
                      {
                               MemoryStream ms = new MemoryStream(byteArrayIn);
                               Image returnImage = Image.FromStream(ms);
                               return returnImage;
                      }

    but i face with this problem on " Image returnImage = Image.FromStream(ms);": Parameter is not valid. What should i do? PLease HELP! thank you!

    modified on Thursday, November 5, 2009 6:55 PM

    L 1 Reply Last reply
    0
    • M maysam gamini

      Dear Wes Aday, If you do more attention, you will find that, my question is relative to C# problem. i need to know what functions or method or classes should i use to solve my problem in C#! Well i found that, it's definitely a String Base 64, 'cause I was able to build a byte array from it with this code: string strData = dataGridView1[2, 0].Value.ToString(); byte[] data = Convert.FromBase64String(strData); and now the thing that i'm looking for is: How could i make an image from byte? thank you!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #5

      maysam gamini wrote:

      If you do more attention

      If you would go back and read your original post, no where in the post is any reference to any C# code that you have tried to address your database problem. I paid very careful attention. In any case you might try this C# Image to Byte Array and Byte Array to Image Converter Class[^]

      Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns Help humanity, join the CodeProject grid computing team here

      M 1 Reply Last reply
      0
      • L Lost User

        maysam gamini wrote:

        If you do more attention

        If you would go back and read your original post, no where in the post is any reference to any C# code that you have tried to address your database problem. I paid very careful attention. In any case you might try this C# Image to Byte Array and Byte Array to Image Converter Class[^]

        Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns Help humanity, join the CodeProject grid computing team here

        M Offline
        M Offline
        maysam gamini
        wrote on last edited by
        #6

        THank you Wes Aday, i use this :

        public Image ByteToImageConvert(byte[] byteArrayIn)
        {
        MemoryStream ms = new MemoryStream(byteArrayIn);
        Image returnImage = Image.FromStream(ms);
        return returnImage;
        }

            private void button2\_Click(object sender, EventArgs e)
            {
                string strData = dataGridView1\[2, 0\].Value.ToString();
                byte\[\] data = Convert.FromBase64String(strData);
                pictureBox1.Image = ByteToImageConvert(data);
            }
        

        but i face with this problem on " Image returnImage = Image.FromStream(ms);": Parameter is not valid. What should i do? PLease HELP! thank you!

        L 1 Reply Last reply
        0
        • M maysam gamini

          THank you Wes Aday, i use this :

          public Image ByteToImageConvert(byte[] byteArrayIn)
          {
          MemoryStream ms = new MemoryStream(byteArrayIn);
          Image returnImage = Image.FromStream(ms);
          return returnImage;
          }

              private void button2\_Click(object sender, EventArgs e)
              {
                  string strData = dataGridView1\[2, 0\].Value.ToString();
                  byte\[\] data = Convert.FromBase64String(strData);
                  pictureBox1.Image = ByteToImageConvert(data);
              }
          

          but i face with this problem on " Image returnImage = Image.FromStream(ms);": Parameter is not valid. What should i do? PLease HELP! thank you!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #7

          I wouldn't be too sure that the string is encoded in base 64 unless you know for sure that it is. Would be unusual to my way of thinking. I am thinking that the MemoryStream is the invalid parameter because the byte array is invalid.

          maysam gamini wrote:

          string strData = dataGridView1[2, 0].Value.ToString();

          try something like:

          byte [] data = new ASCIIEncoding().GetBytes(strData);
          MemoryStream ms = new MemoryStream(data);
          Image im = new Image.FromStream(ms);

          Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns Help humanity, join the CodeProject grid computing team here

          M 1 Reply Last reply
          0
          • L Lost User

            I wouldn't be too sure that the string is encoded in base 64 unless you know for sure that it is. Would be unusual to my way of thinking. I am thinking that the MemoryStream is the invalid parameter because the byte array is invalid.

            maysam gamini wrote:

            string strData = dataGridView1[2, 0].Value.ToString();

            try something like:

            byte [] data = new ASCIIEncoding().GetBytes(strData);
            MemoryStream ms = new MemoryStream(data);
            Image im = new Image.FromStream(ms);

            Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns Help humanity, join the CodeProject grid computing team here

            M Offline
            M Offline
            maysam gamini
            wrote on last edited by
            #8

            Thank you, but unfortunately i sill have he same problem as before. Parameters is not valid!

            private void button2_Click(object sender, EventArgs e)
            {
            string strData = dataGridView1[2, 0].Value.ToString();
            byte[] data = new ASCIIEncoding().GetBytes(strData);
            MemoryStream ms = new MemoryStream(data);
            Image im;
            im = Image.FromStream(ms);//Parameters is not valid! :((
            pictureBox1.Image = im;
            }

            L 1 Reply Last reply
            0
            • M maysam gamini

              Dear Friends, Well i found that, it's definitely a String Base 64, 'cause I was able to build a byte array from it with this code:

              string strData = dataGridView1[2, 0].Value.ToString();//this from visit table in sample database that i //attached
              byte[] data = Convert.FromBase64String(strData);

              and i use this :

              public Image ByteToImageConvert(byte[] byteArrayIn)
                                {
                                         MemoryStream ms = new MemoryStream(byteArrayIn);
                                         Image returnImage = Image.FromStream(ms);
                                         return returnImage;
                                }

              but i face with this problem on " Image returnImage = Image.FromStream(ms);": Parameter is not valid. What should i do? PLease HELP! thank you!

              modified on Thursday, November 5, 2009 6:55 PM

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #9

              maysam gamini wrote:

              Parameter is not valid.

              I think this message is telling you that the stream is not a valid image stream. It does not matter how you create the stream, unless it is a valid image it will not convert. You need to check the format of correct image streams and then compare to your data to see what the differences are.

              M 1 Reply Last reply
              0
              • L Lost User

                maysam gamini wrote:

                Parameter is not valid.

                I think this message is telling you that the stream is not a valid image stream. It does not matter how you create the stream, unless it is a valid image it will not convert. You need to check the format of correct image streams and then compare to your data to see what the differences are.

                M Offline
                M Offline
                maysam gamini
                wrote on last edited by
                #10

                thank YOu! Guys, I attached the Database File and all information that i have, please just try, and find a soloution for me. tnx! i probably know what the problem is, but i don't know how could i handle it! :(( :confused: :((

                L 1 Reply Last reply
                0
                • M maysam gamini

                  thank YOu! Guys, I attached the Database File and all information that i have, please just try, and find a soloution for me. tnx! i probably know what the problem is, but i don't know how could i handle it! :(( :confused: :((

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #11

                  maysam gamini wrote:

                  Guys, I attached the Database File and all information that i have, please just try, and find a soloution for me.

                  I don't have the time or the expertise to do this; I am sorry but the problem is yours to resolve. People here will help where they can but if you need a full solution you will probably have to pay someone for it.

                  M 1 Reply Last reply
                  0
                  • L Lost User

                    maysam gamini wrote:

                    Guys, I attached the Database File and all information that i have, please just try, and find a soloution for me.

                    I don't have the time or the expertise to do this; I am sorry but the problem is yours to resolve. People here will help where they can but if you need a full solution you will probably have to pay someone for it.

                    M Offline
                    M Offline
                    maysam gamini
                    wrote on last edited by
                    #12

                    ok THANK YOU!

                    1 Reply Last reply
                    0
                    • M maysam gamini

                      Thank you, but unfortunately i sill have he same problem as before. Parameters is not valid!

                      private void button2_Click(object sender, EventArgs e)
                      {
                      string strData = dataGridView1[2, 0].Value.ToString();
                      byte[] data = new ASCIIEncoding().GetBytes(strData);
                      MemoryStream ms = new MemoryStream(data);
                      Image im;
                      im = Image.FromStream(ms);//Parameters is not valid! :((
                      pictureBox1.Image = im;
                      }

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #13

                      Sorry Like Richard said. There are 2 things that I can think of: 1. It's not really a valid image stream. That is, the data is not an image but something else. 2. The data string is encrypted. BTW I think that you will have a hard finding someone that will take your database and just open it up. Especially from an unknown source. *I* won't do it. Good luck.

                      Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns Help humanity, join the CodeProject grid computing team here

                      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