I would like to use the csharp interactive shell to run a script file. Is this possible?
Here is an example (not tested): linux$ cat script-file > csharp Connecting... Copying... Done. linux$ Example script (not tested): LoadLibrary("System.Data.dll"); LoadLibrary("System.Data.OracleClient"); using System.Data; using System.Data.SqlClient; using System.Data.OracleClient; Console.WriteLine("Connecting..."); SqlConnection sourcedb = SqlConnection("..."); sourcedb.Open(); SqlCommand sourceCmd = sourcedb.CreateCommand(); sourceCmd.CommandText = "SELECT somecolumn FROM sometable WHERE C = 'A'"; string value = (string) sourceCmd.ExecuteScalar(); OracleConnection targetdb = OracleConnection("..."); targetdb.Open(); Console.WriteLine("Copying..."); OracleCommand targetCmd = targetdb.CreateCommand(); targetCmd.CommandText = "INSERT INTO sometable (column1) VALUES ('" + value + "')"; targetCmd.ExecuteNonQuery(); targetCmd.CommandText = "COMMIT"; targetCmd.ExecuteNonQuery(); sourcedb.Close(); targetdb.Close(); Console.WriteLine("Done."); _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list