//*********************************************************************************** static public void MYSQL_SP_DATAREADER() { using (XwDbCommand sql = new XwDbCommand("DBCONN_MYTEST")) { sql.Mode = XwDbMode.DataReader; sql.AddParameter("$Name", "%C%"); sql.ExecuteSP("TestSP"); Console.WriteLine(sql.GetDebugCommand()); while (sql.Read()) { Console.WriteLine(sql.Value("Name").ToString()); } } }
//*********************************************************************************** static public void MYSQL_MANY_CONNS() { for (int i = 0; i < 20; i++) { using (XwDbCommand sql = new XwDbCommand("DBCONN_MYTEST")) { sql.Mode = XwDbMode.DataReader; sql.AddParameter("$Name", "%C%"); sql.ExecuteSP("TestSP"); Console.WriteLine(sql.GetDebugCommand()); while (sql.Read()) { } } } }
//*********************************************************************************** static public void MSSQL_SP_DATASET() { using (XwDbCommand sql = new XwDbCommand("DBCONN_MSTEST")) { sql.Mode = XwDbMode.DataSet; sql.AddParameter("@Name", "%C%"); sql.ExecuteSP("TestSP"); Console.WriteLine(sql.GetDebugCommand()); if (sql.ReturnedData) { Console.WriteLine($"CNT: {sql.RowCount}"); while (sql.Read()) { Console.WriteLine(sql.Value("Name").ToString()); } } } }