using System; >using System.Data; >using System.Data.OleDb; > >namespace TestData >{ > /// <summary> > /// Summary description for TestData. > /// </summary> > public class TestData > { > public TestData() > { > > // string myConnString = "Provider=VFPOLEDB.1;Data Source=C:\\Temp\\Data\\TasTrade.DBC;Mode=Share De" + > // "ny None;Extended Properties=\"\";User ID=\"\";Password=\"\";Mask Password=False;Cache " + > // "Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE"; > > string myConnString = "Provider=VFPOLEDB.1;Data Source=C:\\TEMP\\DATA\\TASTRADE.DBC;Mode=Share Deny None;" + > "Extended Properties=\"\";User ID=\"\";Password=\"\";Mask Password=False;" + > "Cache Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE"; > > OleDbConnection myConnection = new OleDbConnection(myConnString); > > string myCmd; > myCmd = "DeleteOrder" ; // Stored procedure that just deletes one record with DELETE - SQL command > > OleDbCommand myCommand = new OleDbCommand(myCmd,myConnection); > > myConnection.Open(); > > int cmdResults = -1 ; > > myCommand.CommandType = CommandType.StoredProcedure ; > > try > { > cmdResults = myCommand.ExecuteNonQuery(); // NonQuery since no SQL rows are returned > > } > catch(System.Data.OleDb.OleDbException e) > { > Console.WriteLine("Error occured: " + e.Message); > } > finally > { > myConnection.Close(); > Console.WriteLine("cmdResults " + cmdResults); > Console.ReadLine(); > } > } > public static void Main() > { > TestData foo = new TestData(); > } > } >}