 |
|
 |
biztig i do like to have your ID maybe we can be good friend and we will help us thank you for your example it's very important for me.
|
|
|
|
 |
|
 |
Yantarian: Hi I'm from Armenia and I have friends with such surname (Yantarian). That is very rare meeting surname and they want to find their relatives in the world. If your surname is the same or almost the same please reply to mail:
avodavtyan@yahoo.com
thanks
|
|
|
|
 |
|
 |
I would like to know what will happen if the user deletes all the data from table and saves it.
Then he closes tha application, opens it and try to insert data into table. Shouldn't there be some schema to be based on?
|
|
|
|
 |
|
 |
A fairy from guangxi naning, I an boy from guiling !
good luck!
|
|
|
|
 |
|
 |
Hey Guy´s.
Please dont fret over one or the other shortcoming in the article or the used technology.
Most things are invented someplace else.
This is a good idea for its end and purposes, it will not save the world but is very usable.
We are here for exchanging ideas, not perfect complete solutions to all the enigmas on this planet
Cute idea to have an "alias pop-star - image" representing oneself.
Will try that myself ...
Larz
|
|
|
|
 |
 | Comment  |  | Anonymously | 16:09 10 Sep '03 |
|
 |
What you are saying is, we can use XML files to store application data and we can load these files into DataSet objects. But you lose some advantages and flexibility of a real relational database when doing this:
a) You can't have multiple applications/threads updating the same "database".
b) You can't use sql statement to query the database.
c) You have to load/update the whole "database" even if all you need is a single record.
|
|
|
|
 |
|
 |
Yes,I only use it to become a simple database.My ablility is poor,so a) and c) questions I can't resolve it.
But I want to write a compilation units for question b) for a period of time.
Thanks.
hm,hm......
|
|
|
|
 |
|
 |
jam_snake wrote:
But I want to write a compilation units for question b) for a period of time.
Before doing that, tell us more about the girl whose picture is in your profile
|
|
|
|
 |
|
|
 |
|
 |
You can have multiple apps accessing the database by using mutexes.
I do something similar, but I serve up the database through a server that accepts connections and delivers the database because there are numerous simultaneous updates.
I update via GetChanges. I send the changes to the server, and it handles them. This works with numerous apps.
Yes, the whole database is sent everytime, but again this is for small databases. I've got several thousand records and performance is good over our slow network.
|
|
|
|
 |
|
 |
Yantarian. I'm from Armenia and I have friends with such surname. That is very rare meeting surname and thet want to find their relatives in the world. If your surname is the same or almost the same please reply to mail:
avodavtyan@yahoo.com
thanks
|
|
|
|
 |
|
 |
Well, there are poor-man ways to get around this. For instance, you can restrict access to the dataset using lock statements and you can run very basic portions of sql-type syntax in ds.table.select() statements. Also, when you lock a dataset, you only restrict write capabilities, while read requests continue. I believe this can give you dirty reads, so maybe you would be better off using lock(this).
Reading xml into a dataset is a simple solution counter to using a database, but its not very efficient if you expect lots of simultaneous requests on the dataset itself.
|
|
|
|
 |
|
 |
The methods I had finished before I finished this article.I think someone can make the methods after they view this article.Now the methods code is listed.;P
///
///update( 更新)
/// public bool updateSettings(string tables,string rows,string cols)
///
/// string,you will update this table in a inited DataSet 将文件转换为数据集后其中的某个表名
/// string,you will update this column in the table 此表中的某一列
/// string,update value 转换的值
/// bool,更新是否成功
public bool updateSettings(string tables,string cols,string upStr)
{
bool result=false;
try
{
DataTable dt=ds.Tables[tables];
//Rows[0] is the first row in the table.If you want to update the other rows,you can use search method first.
DataRow dr=dt.Rows[0];
dr[cols]=upStr;
ds.WriteXml(fileName);
result=true;
}
catch(Exception ex)
{
//exStr is a public variable in the class.
exStr=ex.ToString();
result=false;
}
return result;
}
This method is add a row in the table.I use it to write a log file.
///
///write a log 写日志。
///public void writeLogs(string operators,string events)
///
/// my system's operator 系统的操作者
/// my system's event 操作的事件。
/// void.
public void writeLogs(string operators,string events)
{
DataRowCollection rc;
DataRow myNewRow;
object[] rowVals = new object[3];
rc = dt.Rows;
rowVals[0] = operators;
rowVals[1] = events;
rowVals[2] = System.DateTime.Now.ToString();
myNewRow = rc.Add(rowVals);
ds.WriteXml(logFile);
}
Sorry,my email server can not work,so I use the other name to reply the question.
|
|
|
|
 |
|
 |
You should Read and Write the XML file using XmlReadMode.ReadSchema and XmlWriteMode.WriteSchema.
This will add much to the database including strong typing. The inline schema is a small overhead for the benefit you get.
|
|
|
|
 |
|
 |
Yantarian. I'm from Armenia and I have friends with such surname. That is very rare meeting surname and thet want to find their relatives in the world. If your surname is the same or almost the same please reply to mail:
avodavtyan@yahoo.com
thanks
|
|
|
|
 |
|
 |
You left out updating of data in the database. I think that is a key part that you have missed to completing this article. Adding that would make it a good straight forward article in my opinion. Also when you are looping the deleterows method, you shouldn't have to call ds.WriteXml every delete, you should just be able to call it once, as soon as the loop is finished right?
Thanks.
I'm looking forward to the "update" and even "add" functions.
|
|
|
|
 |
|
 |
Could you, or anybody else, tell us what would be a reasonable size of xml file? For example, how many text pages of A4 can I place in xml file and still ensure good performance while searching for particular words, lets say.
thanks
deodatus
|
|
|
|
 |
|
 |
I was working on a soloution which used XML files as a backbone database, i personaly wouldn't recommand it if your XML is going to be any thing over 1MB as it takes almost 10 seconds on 2Ghz, 1.2GB Ram to load the xml into dataset, a good alternative is SQLite, there is a .net provider for it, doesn't need any driver or installation on the client (not even MDAC). all you need is 2 dll files (300K). and its free.
|
|
|
|
 |
|
 |
I did a project a while back using XML as a database (read only). It held the entire bible. That's a lot of A4! I used xpath for searching, load time and search time was quite adequate for the purpose, unless you searched for some realy common word like 'the'.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
 |
|
 |
It's not enough to show a screenshot of visual studio and a tiny bit of source code. You need to add a lot to this article to make it good. Also you should check other articles here at codeproject because you have not presented anything new.
dog_spawn
http://www.hatekill.com[^]
|
|
|
|
 |
|
 |
dog_spawn,
could you post one of the many links to share with anyone who is reading this article?
Thanks.
|
|
|
|
 |