Exemple #1
0
 public static DataSet GetDataTables(List <string> tableNames)
 {
     try
     {
         if (tableNames == null || tableNames.Count == 0)
         {
             return(null);
         }
         DbWebSvc.DbWebSvcSoapClient dbsc = new DbWebSvc.DbWebSvcSoapClient();
         DataSet ds = dbsc.GetDataTables(tableNames.ToArray());
         if (ds == null || ds.Tables.Count == 0)
         {
             return(null);
         }
         else
         {
             return(ds);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return(null);
     }
 }
Exemple #2
0
 public static void InsertWithParams(string tableName, DbParam[] dbParams)
 {
     try
     {
         DbWebSvc.DbWebSvcSoapClient dbsc = new DbWebSvc.DbWebSvcSoapClient();
         dbsc.InsertWithParam(tableName, SerializeObject(dbParams));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #3
0
 public static void ExecuteBatchSql(List <string> sqlList)
 {
     try
     {
         DbWebSvc.DbWebSvcSoapClient dbsc = new DbWebSvc.DbWebSvcSoapClient();
         dbsc.ExecuteBatchSQL(sqlList.ToArray());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #4
0
 public static void ExecuteSql(string strSql)
 {
     try
     {
         DbWebSvc.DbWebSvcSoapClient dbsc = new DbWebSvc.DbWebSvcSoapClient();
         dbsc.ExecuteSql(strSql);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #5
0
 public static void ExecuteSP(string procName, DbParam[] dbParams)
 {
     try
     {
         //DbWebSvc.MySqlParameter[] ops = GetMySqlParameters(dbParams);
         DbWebSvc.DbWebSvcSoapClient dbsc = new DbWebSvc.DbWebSvcSoapClient();
         dbsc.ExecuteStoredProcedure(procName, SerializeObject(dbParams));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #6
0
 public static void UpdateWithParams_2(string tableName, DbParam[] dbParams, int keyNum)
 {
     try
     {
         //DbWebSvc.MySqlParameter[] ops = GetMySqlParameters(dbParams);
         DbWebSvc.DbWebSvcSoapClient dbsc = new DbWebSvc.DbWebSvcSoapClient();
         dbsc.UpdateWithParam_2(tableName, SerializeObject(dbParams), keyNum);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #7
0
 public static DataTable GetDataTableFromSql(string strSql)
 {
     try
     {
         DbWebSvc.DbWebSvcSoapClient dbsc = new DbWebSvc.DbWebSvcSoapClient();
         DataSet ds = dbsc.GetDataFromSql(strSql);
         if (ds == null || ds.Tables.Count == 0)
         {
             return(null);
         }
         else
         {
             return(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return(null);
     }
 }