Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can i use Xml Serialization with gridview?
    primarykey
    data
    text
    <p>i try to use xml serilization in gridview but it returns me: InvalidOperationException was unhandled by user code</p> <p>My code:</p> <pre><code> using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Xml.Serialization; using System.IO; namespace WebAppl_serilization { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { FileStream myStream = new FileStream("GridView.XML", FileMode.Create); XmlSerializer myXs = new XmlSerializer(typeof(GridView)); myXs.Serialize(myStream, gv); myStream.Close(); Console.WriteLine("Devam etmek için bir tuşa basın"); Console.ReadLine(); FileStream mySecondFS = new FileStream("GridView.XML", FileMode.Open); XmlSerializer mySecondXs = new XmlSerializer(typeof(GridView)); GridView test = (GridView)mySecondXs.Deserialize(mySecondFS); mySecondFS.Close(); //foreach (GridView grd in test) //{ // Console.Write(grd.); //} Console.ReadKey(); } } } </code></pre> <p><b>i t throw me: XmlSerializer myXs = new XmlSerializer(typeof(GridView)); </b> error message: InvalidOperationException was unhandled by user code <b>Detail:</b> 'System.Web.UI.WebControls.GridView' was an error reflecting type.<br> <br>my html source:</p> <pre><code> &#60;div&#62; &#60;asp:GridView ID="gv" runat="server" AutoGenerateColumns="false"&#62; &#60;Columns&#62; &#60;asp:BoundField DataField="Kitap" HeaderText="Kitap" /&#62; &#60;/Columns&#62; &#60;/asp:GridView&#62; &#60;/div&#62;</code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload