public static void TestData2() { // try // { GWDataTable mytable = new GWDataTable("", "students"); //GWDataTable mytable = new GWDataTable(); Dictionary <string, string> myrow = new Dictionary <string, string>(); myrow.Add("Name", "Brad"); myrow.Add("Age", "43"); mytable.Add(myrow); // Console.WriteLine(mytable.toXml()); Dictionary <string, string> myrow2 = new Dictionary <string, string>(); myrow2.Add("Name", "Cathy"); myrow2.Add("Age", "39"); mytable.Add(myrow2); //GWDataTable results = mytable.find("Name='Cathy'"); GWDataTable results = mytable.find("[ Name _EQ_ 'Cathy' ]"); Console.WriteLine(results.toXml()); //Console.WriteLine(mytable.toXml()); //System.out.println(mytable.toXml()); }
public static void TestStudentService() { StudentService myStudents = new StudentService(); myStudents.Insert("{\"Name\":\"Brad\",\"Address\":\"Test\",\"ID\":\"4\"}"); GWDataTable all = myStudents.Search("[ ID _GT_ 0 ]"); Student first = (Student)all.GetRow(0); Console.WriteLine("Name is " + first.getName()); }
public static void FileIOTests() { //Method #1 //GWDataIO FileTest = new GWDataIO(); //FileTest.insert("test","c:\\temp\\DataIOTest.config"); //Medhot #2 GWDataIO FileTest = new GWDataIO("c:\\temp\\DataIOTest.config"); FileTest.Insert("{\"Name\":\"Brad\",\"Address\":\"Test\",\"ID\":\"4\"}"); GWDataTable result = FileTest.Search("[ Name _EQ_ \"Brad\" ] !nodeleted"); Console.WriteLine(result.toXml()); }
public static void TestData() { string xmlData = File.ReadAllText(@"c:\temp\abc.xml"); GWDataTable mytable = new GWDataTable(); mytable.loadXml(xmlData); for (int i = 0; i < mytable.length(); i++) { GWRowInterface col = mytable.GetRow(i); foreach (KeyValuePair <string, string> entry in col.entrySet()) { Console.WriteLine(entry.Key + ":" + entry.Value); } } }
public static void TestStudent() { string xmlData = File.ReadAllText(@"c:\temp\student.xml"); GWDataTable mytable = new GWDataTable("", "root", "Student"); mytable.loadXml(xmlData); GWDataTable ret = mytable.find("[ Name _LIKE_ \"Mike Gold\" ]"); Console.WriteLine("Len is " + ret.length()); for (int i = 0; i < ret.length(); i++) { Student col = (Student)ret.GetRow(i); Console.WriteLine("Name is " + col.getName()); } }