Hi
I am working on a .NET 2.0 application using UltraWingrid.
I am saving the layout of the grid as follows.
Dim MS As New IO.MemoryStream() Me.grdData.DisplayLayout.Save(MS, Infragistics.Win.UltraWinGrid.PropertyCategories.All)
Dim LayoutArray() As Byte LayoutArray = MS.ToArray()
GridLayoutsTable.Rows.Add(New Object() {Nothing, "MyGridLayout", LayoutArray})
I am getting an error as "Input array is longer than the number of columns in this table."
How to Save the layout values to Database and Load it again?
Thanks
Ashok
I'm honestly not sure what the best way of storing the byte array in the database would be, though I think that this is dependant on which type of DB you have. This isn't really a UI question or specific to the grid, since you'd have the same problem storing an image, so you may want to try posting in the relevant forum of your DB provider, unless someone else on the forum has some experience with this and wants to chime in.
You might want to just look at a Google search for storing a byte array in the database.
-Matt
Hi Matt
Thanks for your reply. How byte array can be saved to database?
I save layout properties in a memory stream and then convert it into a byte array.
The length of the byte array is more that ten thousand. Can you suggest how these many can be saved in the Database?
Can you send some sample code or article on this?
The error looks like you're trying to add three cells to the row when in fact there are only two columns in the table; you need to make sure that you define the columns. With that being said, are you planning on serializing multiple different layouts at the same time? If not, using a DataTable might not make any sense and you would be better off passing the byte array to the DB directly through whichever means you prefer.