Hi,
in VS 2008, I just created a new Project (WinForm) and added BaseXClient.cs to to the project.
Be sure to add
using BaseXClient;
at the top of C# files that should be able to execute queries, because that is the namespace the "Session" class is in.
Something like:
// create session Session session = new Session("localhost", 1984, "admin", "admin");
// Version 1: perform command and show result or error output if (session.Execute(cmd)) { //MessageBox.Show(session.Result); dom = new XmlDocument(); dom.CreateXmlDeclaration("1.0", "UTF-8", "yes"); dom.LoadXml(session.Result); }
then should work.
Regards,
Maxi
2010/10/13 Ramon F Herrera ramon@patriot.net
(Newbie Alert: both in BaseX and C#)
Hello folks,
I have been considering Java and C# for BaseX-based development. My Java experiments are going quite well.
C##: First, I created 4 new blank projects in Visual Studio 2010 for the sample apps (BaseXClient.cs, CreateExample.cs, Example.cs, QueryExample.cs).
After I added the references "System" and "Microsoft.CSharp" most of the errors went away, but there are 2 remaining:
(1) The types "Session" and "Query" are not recognized. I am sure they are somehow part of BaseX. How do I add support for those types? It probably involves creating some reference and adding it, correct?
(2) The other type that is not recognized is "Stopwatch". Microsoft provides one such class:
http://msdn.microsoft.com/en-us/library/ebf7z0sw.aspx
which has a "Start" method and a "ElapsedMilliseconds" property.
That class is not recognized, however. I am using the provided source code, verbatim:
https://svn.uni-konstanz.de/dbis/basex/trunk/api/etc/c%23/Example.cs
Thanks again for such a great package!
-Ramon
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk