1.
This is wrong!
sqlstring = "execute myprocedure";
If you plan to use
CommandType.StoredProcedure it should be:
sqlstring = "myprocedure";
2.
Try this:
using(OleDbConnection connection = new OleDbConnection(connectionString))
{
OleDbCommand command = new OleDbCommand("myprocedure",connection);
command.CommandType = CommandType.StoredProcedure;
try
{
connection.open();
command.ExecuteNonQuery();
}
catch (OledbExcpetion olex)
{
Debug.WriteLine(olex.ToString());
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
finally
{
connection.Close();
}
}