private static void AlterColumn(string tbid, string serverid) { Tz.Net.DataManager dm = new Tz.Net.DataManager(tbid, serverid); string fields; fields = System.Console.ReadLine(); fields = "83eabe2691bc40dfb426c9ee741c65f9755807932,changepass,Password"; var fs = fields.Split(','); //foreach (string s in fs) //{ dm.ChangeField(fs[0], fs[1], System.Data.DbType.Int32, 100, true, false, ""); //} dm.AcceptChanges(); System.Console.WriteLine("fields added"); System.Console.ReadLine(); }
private static void CreateTable(out string tableid, out string serverid) { string tablename = ""; System.Console.WriteLine("Enter TableName"); tablename = System.Console.ReadLine(); System.Console.WriteLine("Enter Field name seperated by ,"); string fields = ""; tableid = ""; fields = System.Console.ReadLine(); var fs = fields.Split(','); serverid = CreateServer(); if (serverid != "") { Tz.Net.DataManager dm = new Tz.Net.DataManager(serverid, ""); dm.NewTable(tablename, "sys"); foreach (string s in fs) { if (s == "UserID") { dm.AddPrimarykey(s, System.Data.DbType.String, 25); // dm.AddField(s, System.Data.DbType.String, 25, true); } else { dm.AddField(s, System.Data.DbType.String, 25, true); } } try { dm.AcceptChanges(); tableid = dm.getTableID(); System.Console.WriteLine("table created"); System.Console.ReadLine(); } catch (System.Exception ex) { tableid = ""; System.Console.WriteLine(ex.Message); } } }
private static void addColumn(string tbID, string serverid) { Tz.Net.DataManager dm = new Tz.Net.DataManager(tbID, serverid); string fields; fields = System.Console.ReadLine(); var fs = fields.Split(','); foreach (string s in fs) { if (s == "UserID") { dm.AddPrimarykey(s, System.Data.DbType.String, 25); } else { dm.AddField(s, System.Data.DbType.String, 25, true); } } dm.AcceptChanges(); System.Console.WriteLine("fields added"); System.Console.ReadLine(); }