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. Update Resource(.resx) file

Update Resource(.resx) file

Scheduled Pinned Locked Moved C#
questionannouncementlearning
7 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.
  • K Offline
    K Offline
    Krishnraj
    wrote on last edited by
    #1

    Hi all, I have one resource file and i want to update and delete the content from the resource file programetically, but when i update the resource file thru one form then it will insert the new record rather than update. Below is my code. ResXResourceWriter w = new ResXResourceWriter("ResXForm.resx"); w.AddResource("test", "test123"); w.Generate(); w.Close(); And when i insert the record programetically, at that time it will insert the record, but it will overright the previous record. how it is possible ?:confused:

    Rana Krishnraj

    L M 2 Replies Last reply
    0
    • K Krishnraj

      Hi all, I have one resource file and i want to update and delete the content from the resource file programetically, but when i update the resource file thru one form then it will insert the new record rather than update. Below is my code. ResXResourceWriter w = new ResXResourceWriter("ResXForm.resx"); w.AddResource("test", "test123"); w.Generate(); w.Close(); And when i insert the record programetically, at that time it will insert the record, but it will overright the previous record. how it is possible ?:confused:

      Rana Krishnraj

      L Offline
      L Offline
      LongRange Shooter
      wrote on last edited by
      #2

      So let's see here ... you execute an AddResource and yet you cannot figure out why it is ADDING the record instead of updating???? I suggest you find another career or go back to school. But if you insist on remaining a programmer, then I just gave you the clue to your answer.

      K 1 Reply Last reply
      0
      • L LongRange Shooter

        So let's see here ... you execute an AddResource and yet you cannot figure out why it is ADDING the record instead of updating???? I suggest you find another career or go back to school. But if you insist on remaining a programmer, then I just gave you the clue to your answer.

        K Offline
        K Offline
        Krishnraj
        wrote on last edited by
        #3

        Hey, i know i use addsource but u know what happen is ?? suppose i have 4 records in my resource file and when i add new record programetically at that time it will erase previous 4 records and add new i records so right now i have only one records in my resource file. so understand it will not append the records. i know its my mistake in asking question but from now do not use this kind of words ok..:mad: and if u don't know then do not reply with this kind of words understand.

        Rana Krishnraj

        L 2 Replies Last reply
        0
        • K Krishnraj

          Hey, i know i use addsource but u know what happen is ?? suppose i have 4 records in my resource file and when i add new record programetically at that time it will erase previous 4 records and add new i records so right now i have only one records in my resource file. so understand it will not append the records. i know its my mistake in asking question but from now do not use this kind of words ok..:mad: and if u don't know then do not reply with this kind of words understand.

          Rana Krishnraj

          L Offline
          L Offline
          LongRange Shooter
          wrote on last edited by
          #4

          The very, very basic process of changing an element in an array: resource["text"] = "test 123";

          1 Reply Last reply
          0
          • K Krishnraj

            Hey, i know i use addsource but u know what happen is ?? suppose i have 4 records in my resource file and when i add new record programetically at that time it will erase previous 4 records and add new i records so right now i have only one records in my resource file. so understand it will not append the records. i know its my mistake in asking question but from now do not use this kind of words ok..:mad: and if u don't know then do not reply with this kind of words understand.

            Rana Krishnraj

            L Offline
            L Offline
            LongRange Shooter
            wrote on last edited by
            #5

            Doing a little googling I find that you have done two things wrong. First you defined your FileStream wrong. You have it set of Create or Open and do not have it set for ReadWrite Next you are only using AddResource for everything. Look at AddResourceData. If none of those help then you are SOL. And while you may not like what I say, I do not like jobs stolen by cheap Indian labor and then having the same job theives coming here begging us to write their code for them or help them become programmers.

            K 1 Reply Last reply
            0
            • L LongRange Shooter

              Doing a little googling I find that you have done two things wrong. First you defined your FileStream wrong. You have it set of Create or Open and do not have it set for ReadWrite Next you are only using AddResource for everything. Look at AddResourceData. If none of those help then you are SOL. And while you may not like what I say, I do not like jobs stolen by cheap Indian labor and then having the same job theives coming here begging us to write their code for them or help them become programmers.

              K Offline
              K Offline
              Krishnraj
              wrote on last edited by
              #6

              OK Now don't explain me in air ok. Doing a little googling is not enough ok and one more thing when u make an object of ResXResourceWriter and after that try yo find object's associated methode. there is no any kind of methode that u specufy - AddResourceData() understand u SOL. any way i already implement it. From now don't reply to any body with this kind of words understand u Bhenchode..

              Rana Krishnraj

              1 Reply Last reply
              0
              • K Krishnraj

                Hi all, I have one resource file and i want to update and delete the content from the resource file programetically, but when i update the resource file thru one form then it will insert the new record rather than update. Below is my code. ResXResourceWriter w = new ResXResourceWriter("ResXForm.resx"); w.AddResource("test", "test123"); w.Generate(); w.Close(); And when i insert the record programetically, at that time it will insert the record, but it will overright the previous record. how it is possible ?:confused:

                Rana Krishnraj

                M Offline
                M Offline
                Mahmoud Kohansal
                wrote on last edited by
                #7

                Hi Rana, see this Link,I hope it help you http://sandblogaspnet.blogspot.com/2009/11/updating-resource-file.html[^]

                mahmoud kohansal

                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