FIX: ?????? ??? ?? ????? ????? ???? ???? ??? ????? ????? ????? ????? ???????? DataSet ???????? ??????? ????? SerializationFormat.Binary ?? ????? ????? ??? .NET Framework 2.0

?????? ????????? ?????? ?????????
???? ???????: 948646 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

???? ???? ??? ??????? Microsoft ????? ??? .NET Framework 2.0 ????? ????? ? ????? ????? ???????? DataSet ???????? ??????? ????? SerializationFormat.Binary ? ?? ??? ????? ???????? ???? ????.

?????

???? ??? ??????? ????? ????? ??? ?? ??? System.Design.dll.

????

??????? ??????? ??????

????? ???? ????? ???? ????? ?? Microsoft. ???? ????? ??? ?? ?? ??????? ??????? ?? ??? ??????? ???. ???? ??? ???????? ??? ?? ??????? ???? ????? ??? ??????? ????????.

??? ??? ???????? ???? ?????? ??? ??????? ?? Microsoft "?????? ??? ??????? ??????. ?????? ??? ????? ????? ?????? ?????? ?????? ?????? ??? ??????? ?? Microsoft ???? ??????? ??? ?????? ?????? ?? ?????? ???? Microsoft ?????? ??? ?????:
http://support.microsoft.com/contactus/?ws=support
?????? ?? ??? ???????? ?? ??? ????? ????????? ???? ?????? ????? ??? ??????? ????? ??? ??? ?????? ????? ??? Microsoft ?? ??????? ?????? ??? ???? ??? ?? ???????. ???? ????? ?????? ????? ???????? ??? ????? ????? ???????? ????????? ???? ?? ???? ??? ???? ??? ???????.

????????? ????????

??? ?? ???? ???? .NET Framework 2.0 ????? ????? ??? ??????? ??????.

????? ????? ?????

??? ???? ??? ????? ????? ???? ????????? ??? ????? ??? ??????? ??????.

??????? ??????? ??????? ??????

?? ??? ??? ??????? ?????? ??? ??? ??????? ????? ????.

??????? ?????

????? ????? ????? ?????????? ?? ??? ??????? ?????? ???? ????? (?? ???? ????) ??????? ?? ?????? ??????. ??? ??? ???????? ???????? ?????? ???? ??????? ?? "??? ??????? ???????" (UTC). ????? ???? ???? ??????? ?????? ??? ??????? ??? ??????? ??????. ?????? ????? ??? ??????? ??????? (UTC) ???????? ??????? ?????? ????? ??????? ??????? ??????? ?? ???? ??????? ?????? ?? "???? ??????".
?? ??? ??????????? ??? ??????
??? ?????????? ???????? ????????????????????? ???????
System.design.dll2.0.50727.18155,046,27227 ?????? ????11: 47x 86

?????

???? Microsoft ?? ??? ????? ?? ?????? Microsoft ??????? ?? ??? "????? ???".

????? ????? ????? ???????

  1. ????? ????? ???? ???? ???? ???? "ConsoleAppTestDTset."
  2. ????? ???? DataSet ???? ???? "DsTest.xsd."
  3. ????? ???? ??? DataTable ?????? "dtTest."
  4. ????? ?????? ????? col1 ? col2 ??? ??????. ???? ?? ????? ??? ?????? ?? ???? ??? System.Int32.
  5. ????? ??????? ?????? ??? "???? 2":
    col1 * 2
  6. ?? ??????? ??????? ????? ???????? ???????? ???????:
    static void Main(string[] args)
            {
                // Create a dataset instance.
                DataSet ds = new DsTest();
                // Add a row.
                ds.Tables["dtTest"].Rows.Add(1);
                ds.Tables["dtTest"].Rows.Add(2);
                ds.Tables["dtTest"].Rows.Add(3);
                // Show rows to see that the expression works
                foreach (DataRow dr in ds.Tables["dtTest"].Rows)
                {
                    Console.WriteLine("col1: {0}, col2: {1}", dr[0], dr[1]);
                }
                Console.WriteLine("Expression = " + ds.Tables["dtTest"].Columns["col2"].Expression);
                Console.WriteLine();
                // Do the serialization or the deserialization.
                byte[] serializedDS;
                ds.SchemaSerializationMode = SchemaSerializationMode.ExcludeSchema;
                // Using SerializationFormat.Binary fails.
                ds.RemotingFormat = SerializationFormat.Binary;
                // Using SerializationFormat.Xml works.
                //ds.RemotingFormat = SerializationFormat.Xml;
                
                // Serialize.
                MemoryStream ms = new MemoryStream();
                BinaryFormatter bf = new BinaryFormatter();
                bf.Serialize(ms, ds);
                serializedDS = ms.ToArray();
    
                // Deserialize.
                ms.Write(serializedDS, 0, serializedDS.Length);
                                         ms.Position = 0;
                DataSet newDs = (DataSet)bf.Deserialize(ms);
                // Display the deserialized dataset.
                foreach (DataRow dr in newDs.Tables["dtTest"].Rows)
                {
                    Console.WriteLine("col1: {0}, col2: {1}", dr[0], dr[1]);
                }
                Console.WriteLine("Expression = " + newDs.Tables["dtTest"].Columns["col2"].Expression);
                Console.WriteLine();
    
                Console.WriteLine("Done..!");
                Console.Read();
            }
    When you run the application, the expression string is not displayed in the Output Window as expected.
  7. ?? ??? DsTest.Designer.cs ??? ???? ???????? ???????? ???????:
    [System.Diagnostics.DebuggerNonUserCodeAttribute()]protected DsTest(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context, false) 
    {
       if ((this.IsBinarySerialized(info, context) == true)) 
       {
          this.InitVars(false);   
          System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);   
          this.Tables.CollectionChanged += schemaChangedHandler1;   
          this.Relations.CollectionChanged += schemaChangedHandler1;   
          return;
       }
    ...
    
  8. ??????? ??? ???????? ???????? ???????? ????????? ???????? ???????: ?????
    [System.Diagnostics.DebuggerNonUserCodeAttribute()]protected DsTest(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context, false) 
    {
       if ((this.IsBinarySerialized(info, context) == true)) 
       {
          this.InitVars(false);   
          System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);   
          this.Tables.CollectionChanged += schemaChangedHandler1;   
          this.Relations.CollectionChanged += schemaChangedHandler1;
     
          // These two lines are the only new ones.
          if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.ExcludeSchema))      
             this.InitExpressions();
     
          return;
       }
    ...
    
    ??? ??? ?????? ????? ??????? ????? ??????? ?????? ?? "???? ???????".
?????? ?? ???? ????? ???? DataSet ????? ????? ??????? ????? ??? ???? ??? ??????? ?? ?????? 8.

????? ?? ????????? ??? ??????? ???????? ?? DataSet ???????? ?? ?????? ???? ???? ????? Microsoft (MSDN) ?????? ??? ?????:
http://msdn2.microsoft.com/en-us/magazine/cc163911.aspx
????? ?? ????????? ??? ??????? ????? ??????? "? ???? ??? ??? ??????? ?????? ?????? ??" ????? ??????? ?? Microsoft:
824684??? ????????? ???????? ????????? ?? ??? ??????? ????? Microsoft

???????

???? ???????: 948646 - ????? ??? ??????: 09/???? ??????/1429 - ??????: 1.0
????? ???
  • Microsoft .NET Framework 2.0
????? ??????: 
kbmt kbpubtypekc kbqfe kbhotfixserver kbexpertiseadvanced KB948646 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????948646

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com