Encrypting a datatable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Wright

    #1

    Encrypting a datatable

    I need to covert a datatable to a string so I can pass it into my encryption
    engine. I need to know how to write the xml for a dataset into a string
    variable so I can pass the string into the encryption engine. I don't want
    to persist the data on disk, I want to be able to do this in memory so I can
    discard the string variable when I am done. The engine in use here will only
    accept strings for encryption.


    John Wright


  • Cor Ligthert [MVP]

    #2
    Re: Encrypting a datatable

    John,

    It is in this message converted from VB so watch simple errors

    'Serialize
    System.IO.Strin gWriter sw = new System.IO.Strin gWriter();
    MyDataset.Write Xml(sw);
    string mystring = sw.ToString();
    ''''''''''''''' ''''''''''''''' ''''''''
    'Deserialize
    System.IO.Strin gReader sr = new System.IO.Strin gReader(mystrin g);
    DataSet ds2 = new DataSet();
    ds2.ReadXml(sr) ;

    I thought that this was very simple?

    Cor


    "John Wright" <riley_wrightx@ hotmail.comschr eef in bericht
    news:OUzFfjZvHH A.4552@TK2MSFTN GP03.phx.gbl...
    >I need to covert a datatable to a string so I can pass it into my
    >encryption engine. I need to know how to write the xml for a dataset into
    >a string variable so I can pass the string into the encryption engine. I
    >don't want to persist the data on disk, I want to be able to do this in
    >memory so I can discard the string variable when I am done. The engine in
    >use here will only accept strings for encryption.
    >
    >
    John Wright
    >

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: Encrypting a datatable

      Doh,

      I thought I was in the C# newsgroup



      Sorry

      Cor

      "John Wright" <riley_wrightx@ hotmail.comschr eef in bericht
      news:OUzFfjZvHH A.4552@TK2MSFTN GP03.phx.gbl...
      >I need to covert a datatable to a string so I can pass it into my
      >encryption engine. I need to know how to write the xml for a dataset into
      >a string variable so I can pass the string into the encryption engine. I
      >don't want to persist the data on disk, I want to be able to do this in
      >memory so I can discard the string variable when I am done. The engine in
      >use here will only accept strings for encryption.
      >
      >
      John Wright
      >

      Comment

      • John Wright

        #4
        Re: Encrypting a datatable

        Wow that is simple. Thanks.

        John
        "Cor Ligthert [MVP]" <notmyfirstname @planet.nlwrote in message
        news:ur6ym1ZvHH A.5036@TK2MSFTN GP03.phx.gbl...
        John,
        >
        It is in this message converted from VB so watch simple errors
        >
        'Serialize
        System.IO.Strin gWriter sw = new System.IO.Strin gWriter();
        MyDataset.Write Xml(sw);
        string mystring = sw.ToString();
        ''''''''''''''' ''''''''''''''' ''''''''
        'Deserialize
        System.IO.Strin gReader sr = new System.IO.Strin gReader(mystrin g);
        DataSet ds2 = new DataSet();
        ds2.ReadXml(sr) ;
        >
        I thought that this was very simple?
        >
        Cor
        >
        >
        "John Wright" <riley_wrightx@ hotmail.comschr eef in bericht
        news:OUzFfjZvHH A.4552@TK2MSFTN GP03.phx.gbl...
        >>I need to covert a datatable to a string so I can pass it into my
        >>encryption engine. I need to know how to write the xml for a dataset into
        >>a string variable so I can pass the string into the encryption engine. I
        >>don't want to persist the data on disk, I want to be able to do this in
        >>memory so I can discard the string variable when I am done. The engine in
        >>use here will only accept strings for encryption.
        >>
        >>
        >John Wright
        >>
        >
        >

        Comment

        Working...