|
PLZ I Want to used xml file as database(how to add,update,delete and Search)
i will make the database program
using interface C# and DataBase <xml>
thanks.
|
|
|
|
|
You can want all you want. It's not going to change the fact that XML is NOT a database. You cannot use SQL statements to navigate through the tables. You have to use the various XML methods to modify your tables, but XML is very inefficient at it.
|
|
|
|
|
Dave Kreskowiak wrote: You can't want all you want.
I don't think that is what you meant... :P
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Whoops. I knew that didn't look right when I posted it...
|
|
|
|
|
Unless your data set is very small, this smells of disaster. XPath is how you search XML. The DOM via the XMLDocument class is how you interact up add/update/delete/search.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If You really want you can.Once again Is that you really want to do.
check DataSet members ReadXML()/WriteXML()
load XML Store to Dataset using ReadXML ( on Application Initialization )
Manipulate ( add/delete etc.. ) this DataSet during application life cycle.
On ApplicationExit use WriteXML.
"Sometimes solutions will be as simple as 1=1 , confused right "
By
BAIJUMAX
|
|
|
|
|
how to deploy a project which expires after one month.means how to make a demo application
how to give company name ,version when deployinga project.
monu_khan in trouble
|
|
|
|
|
You can't do that via your deployment, you have to create a demo version. And, you need to ask yourself who your market is. A simple way is just to store the install date somewhere, and check if 30 days have passed. People can get by this by setting their clock back, or just by decompiling your app and removing the check. If your clients are likely to do that, then it's a whole lot harder, but a basic 30 day check is trivial to do.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Do not use the word 'urgent' in your post, it is considered rude. It only will anger most people. Most members on this site come here on their own free-will and are not obligated to replying with rude requests like 'urgent'
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
Well said.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Needed to get somewhat verbose instead of the typical Don't say urgent style of posts.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
Hello,
I have a class without a namespace. The main reason why I don't have a namespace in that class is because I use that class in all my applications.
Now I like to update application settings in that class, but I don't like to use the following line in that class:
using ApplicationNamespace.Properties;
Is there a way where i can reference that up to my class?
|
|
|
|
|
You may think that your class is not contained in a namespace, but it IS in one. The default name for a namespace is the name of the project.
|
|
|
|
|
Well, that's the point, i would like to be able to copy the class everywhere without changing/adding the projects namespace into the class and still updating the namespace's settings.
Maybe it is impossible, but i like to ask.
|
|
|
|
|
Yeah, it is, you can't change the namespace your code is in.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Like Christian said, you can't do that. The namespace is part of the fully qualified name of the class. Changing it is out of the question.
The only way you can use this class in other projects is to add a reference to it's .DLL. Importing the namespace is optional, but it saves you from having to type the full namespace/class path in your other project's code.
|
|
|
|
|
|
Check 'Ignore HTML tags in this message' to post your XML.
Paul Marfleet
|
|
|
|
|
I posted the .xml file I think...
Jon
|
|
|
|
|
<?xml version="1.0"?>
<database schema-name='products'>
<table name='ProductsInStock'>
<column data-type='text' name='Code' pk='true' fkreferences='Product.Code'>
</column>
<column data-type='int' name='Qty'>
</column>
<column data-type='currency' name='CostPrice'>
</column>
</table>
<table name='Product'>
<column data-type='text' name='ProductID' pk='true'>
</column>
<column data-type='text' name='Description'>
</column>
</table>
</database>
Jon
|
|
|
|
|
This code should work
static void Main(string[] args)
{
int ws = 0;
int pi = 0;
int dc = 0;
int cc = 0;
int ac = 0;
int et = 0;
int el = 0;
int xd = 0;
XmlTextReader textReader = new XmlTextReader("../../sample.xml");
while (textReader.Read())
{
XmlNodeType nType = textReader.NodeType;
if (nType == XmlNodeType.XmlDeclaration)
{
Console.WriteLine("Declaration:" + textReader.Name.ToString());
xd = xd + 1;
}
if (nType == XmlNodeType.Comment)
{
Console.WriteLine("Comment:" + textReader.Name.ToString());
cc = cc + 1;
}
if (nType == XmlNodeType.Element)
{
Console.WriteLine("Element:" + textReader.Name.ToString());
el = el + 1;
if (textReader.HasAttributes)
{
while (textReader.MoveToNextAttribute())
{
Console.WriteLine("Attribute:" + textReader.Name.ToString());
ac = ac + 1;
}
}
}
if (nType == XmlNodeType.Entity)
{
Console.WriteLine("Entity:" + textReader.Name.ToString());
et = et + 1;
}
if (nType == XmlNodeType.Entity)
{
Console.WriteLine("Entity:" + textReader.Name.ToString());
pi = pi + 1;
}
if (nType == XmlNodeType.DocumentType)
{
Console.WriteLine("Document:" + textReader.Name.ToString());
dc = dc + 1;
}
if (nType == XmlNodeType.Whitespace)
{
Console.WriteLine("WhiteSpace:" + textReader.Name.ToString());
ws = ws + 1;
}
}
Console.WriteLine("Total Comments:" + cc.ToString());
Console.WriteLine("Total Attributes:" + ac.ToString());
Console.WriteLine("Total Elements:" + el.ToString());
Console.WriteLine("Total Entity:" + et.ToString());
Console.WriteLine("Total Process Instructions:" + pi.ToString());
Console.WriteLine("Total Declaration:" + xd.ToString());
Console.WriteLine("Total DocumentType:" + dc.ToString());
Console.WriteLine("Total WhiteSpaces:" + ws.ToString());
}
The XmlTextReader has specific methods for iterating through Attributes. Use these when you encounter an Element node.
Paul Marfleet
|
|
|
|
|
Thanks.
Basically rather than use the XmlNodeType.Attribute to read attributes, the code should iterate through the attributes within each element to process them:
if (textReader.HasAttributes)
{
while (textReader.MoveToNextAttribute())
{
Console.WriteLine("Attribute:" + textReader.Name.ToString());
ac = ac + 1;
}
}
Jon
|
|
|
|
|
I edited an old project and saved it as a new name, but everytime i move the project to a new folder with it's new name it gives me an error saying cannot find the file.
When i put it back to the old folder and open it, it shows that the current location is C:\Documents and Settings\Nick\Desktop\My Programs\Halo.sln but I can't change the location, Any one know how to change it?
|
|
|
|
|
Try saving the whole solution in another location.
If you just move the solution-folder, your IDE will get confused and
can't find the files that are listed in the file [solution name].sln.
Virtual1ty
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Alright, I'll try that.
-- modified at 15:29 Saturday 6th October, 2007
Can't save the whole solution to a new folder, Looked threw every menu but there is only a Save Save As Save All no Save All As
-- modified at 15:30 Saturday 6th October, 2007
Btw, i'm using Visual Basics C# Express Edition
|
|
|
|