Ejemplo n.º 1
0
 public static NpgsqlDataAdapter NpgAdatpter(string sql)
 {
     try
     {
         if (remoteConnection.State.ToString() == "Closed")
         {
             remoteConnection.Open();
         }
         dataSet = new DataSet();
         Npgadapter.SelectCommand = new NpgsqlCommand(sql.Replace("+", "||").Replace("[", "\"").Replace("]", "\"").Replace("zbroj", "+"), remoteConnection);
         NpgsqlCommandBuilder builder = new NpgsqlCommandBuilder(Npgadapter);
         return(Npgadapter);
     }
     catch (Exception ex)
     {
         Funkcije.SetInLog(sql + "\r\n" + ex.ToString(), "65", "RemoteDB");
         return(Npgadapter);
     }
 }
Ejemplo n.º 2
0
 //UPDATE
 public static string update(string sql)
 {
     try
     {
         if (remoteConnection.State.ToString() == "Closed")
         {
             remoteConnection.Open();
         }
         NpgsqlCommand comm = new NpgsqlCommand(sql, remoteConnection);
         comm.ExecuteNonQuery();
         return("");
     }
     catch (Exception ex)
     {
         remoteConnection.Close();
         Funkcije.SetInLog(sql + "\r\n" + ex.ToString(), "65", "RemoteDB");
         return(ex.ToString());
     }
 }