473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

XML and the Datagrid

Hello,
I am developing a small single user data entry/reporting application, and
was wondering if the approach of using XML with a schema and the datagrid
control is a valid approach or should I use a database instead? I do not
expect the total number of elements to be greater then 2500 rows.

Also, please point me in the direction of any sample applications on this
front.

Thanks,
Dan
Nov 20 '05 #1
6 994
Cor
Hi Dan,

This is so simple to do.

Open a project
Drag a datagrid to the form
Open and XSD file from the solution explorer
Add elements
Right to click make the dataset

Than this code
\\\
Dim dataset11 As New Dataset1
Private Sub Form1_Load(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.DataGrid1.DataSource = dataset11.Tables(0)
End Sub
Private Sub Form1_Closing(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
DirectCast(BindingContext(dataset11.Tables(0)),
CurrencyManager).EndCurrentEdit()
dataset11.WriteXml("c:\tester.xml")
End Sub
///
And your most simple solution is ready.

I hope this helps,

Cor
Nov 20 '05 #2
Cor,

Thanks for responding.

I am familiar with the approach you stated, my question is using XML with
databound controls valid within the context of my specifications e.g. around
2500 rows of related data (4-5 tables), with reporting capabilities.

Dan
"Cor" <no*@non.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Dan,

This is so simple to do.

Open a project
Drag a datagrid to the form
Open and XSD file from the solution explorer
Add elements
Right to click make the dataset

Than this code
\\\
Dim dataset11 As New Dataset1
Private Sub Form1_Load(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.DataGrid1.DataSource = dataset11.Tables(0)
End Sub
Private Sub Form1_Closing(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing DirectCast(BindingContext(dataset11.Tables(0)),
CurrencyManager).EndCurrentEdit()
dataset11.WriteXml("c:\tester.xml")
End Sub
///
And your most simple solution is ready.

I hope this helps,

Cor

Nov 20 '05 #3
Cor
Hi Dan,

I thought that you would use this as a simple and small dataentry solution.

When it is really an application to hold data, than I think it is no good
solution.

My expirience is that it than very unstable.

Most of the time you are doing everything in memory, so when there is a
powerbreak you do lost everyting done till than.

When there is a write error you even can loose totaly everything if you do
not make the right procedures.

Just my thought about it.

Cor.
Nov 20 '05 #4
Cor and Everyone,

In your experience then what good is XML, with the exception of applications
similar to Exchange Server (where each complex object is represented by a
single XML file) and as a means to transporting data.

Dan

"Cor" <no*@non.com> wrote in message
news:e8**************@TK2MSFTNGP11.phx.gbl...
Hi Dan,

I thought that you would use this as a simple and small dataentry solution.
When it is really an application to hold data, than I think it is no good
solution.

My expirience is that it than very unstable.

Most of the time you are doing everything in memory, so when there is a
powerbreak you do lost everyting done till than.

When there is a write error you even can loose totaly everything if you do
not make the right procedures.

Just my thought about it.

Cor.

Nov 20 '05 #5
Cor
Hi Solex,

I think I have had a time the same idea about XML as you.

However, it is to use as database nothing more than a very efficient text
file.
I find it, when it is in memory, exactly as good as the database, because it
uses the same procedures. In addition, when you do not use it as dataset,
you can even do more.

I wished that the complexity from an XML file was in a real database system.

The problem now is for me, that you cannot change items in an XML file while
it stays on disk. You have to read and write it streaming (although in one
time the whole file).

If you use it to get some data out the database, update it and write it back
as it is used now, it is in my opinion a good solution and also very good
usable in a web service where it is used as transport media for that data.

I can think on an option to make small XML files, which holds the data in
good organized small files as it done with some system information.

My problem is specially that when you are using it frequently and you have a
write error with a big XML file, while your recovery is not very well, you
are losing everything, you can make temporary files of course, but when you
use it very often, I think that will fail also.

It is in my opinion the best thing to describe and hold data until now and I
wished that the things I describe above were wrong. Than I get a total
different opinion about your question.

But just my thought about it today,

Cor
Nov 20 '05 #6
Cor,

Thanks for input. I was coming to the same conclusion, the more involved I
got into the project, I am in the process of converting the XML file to a
series of database tables.

XML seems to provide a good data store specifcation when it is applied to
multiple XML files and exist on an application server that has a full-text
search engine.

Thanks Again!

Dan
"Cor" <no*@non.com> wrote in message
news:uF*************@TK2MSFTNGP12.phx.gbl...
Hi Solex,

I think I have had a time the same idea about XML as you.

However, it is to use as database nothing more than a very efficient text
file.
I find it, when it is in memory, exactly as good as the database, because it uses the same procedures. In addition, when you do not use it as dataset,
you can even do more.

I wished that the complexity from an XML file was in a real database system.
The problem now is for me, that you cannot change items in an XML file while it stays on disk. You have to read and write it streaming (although in one time the whole file).

If you use it to get some data out the database, update it and write it back as it is used now, it is in my opinion a good solution and also very good
usable in a web service where it is used as transport media for that data.

I can think on an option to make small XML files, which holds the data in
good organized small files as it done with some system information.

My problem is specially that when you are using it frequently and you have a write error with a big XML file, while your recovery is not very well, you
are losing everything, you can make temporary files of course, but when you use it very often, I think that will fail also.

It is in my opinion the best thing to describe and hold data until now and I wished that the things I describe above were wrong. Than I get a total
different opinion about your question.

But just my thought about it today,

Cor

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
7
by: Dave | last post by:
Are there any add-on products or samples available that can do the following in an vb.net datagrid I want to compare 2 rows in a datagrid - one row from one database and another row for another...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.